Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1201063

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

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: sm750fb: fix sparse warning for lock
Date 2015-08-05 21:10 +0200
Message-ID <pUceB-1SZ-1@gated-at.bofh.it> (permalink)
References <pU6VA-2zD-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
> 
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> Cc: Teddy Wang <teddy.wang@siliconmotion.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/sm750fb/sm750.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 8e201f1..5ba1c06 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -203,6 +203,8 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
>  	 */
>  	if (share->dual)
>  		spin_lock(&share->slock);
> +	else
> +		__acquire(&share->slock);

That's horrid, please don't do stuff like this just to make a static
checker "quiet".

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: sm750fb: fix sparse warning for lock Peng Fan <van.freenix@gmail.com> - 2015-08-05 15:30 +0200
  Re: [PATCH] staging: sm750fb: fix sparse warning for lock Greg KH <gregkh@linuxfoundation.org> - 2015-08-05 21:10 +0200
  Re: [PATCH] staging: sm750fb: fix sparse warning for lock Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-06 00:40 +0200

csiph-web