# Re: \[PATCH\] staging: sm750fb: fix sparse warning for lock

- From: Dan Carpenter \<hidden\>
- Date: 2015-08-05 22:35:27 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2015/08/4551939
- Thread: https://ratatoskr.run/linux-fbdev/2015/08/4551362/t.md

```text
On Wed, Aug 05, 2015 at 09:26:44PM +0800, Peng Fan wrote:
> Use __acquire() and __release() in the right place to silence the sparse
> lock checking warning.
> 
> drivers/staging/sm750fb/sm750.c:177:13: warning: context imbalance in 'lynxfb_ops_fillrect' - different lock contexts for basic block
> drivers/staging/sm750fb/sm750.c:243:9: warning: context imbalance in 'lynxfb_ops_copyarea' - different lock contexts for basic block
> drivers/staging/sm750fb/sm750.c:247:13: warning: context imbalance in 'lynxfb_ops_imageblit' - different lock contexts for basic block
> 

Sparse is really bad at locking stuff.  Smatch is also really bad for
locking and I have been promising to re-write that check for years, but
I take comfort always in the fact that at least it's not as bad as
Sparse.

You should pretty much ignore Sparse locking warnings.

regards,
dan carpenter

```
