All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Cyril Roelandt <tipecaml@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org, balbi@ti.com,
	laurent.pinchart@ideasonboard.com,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] UVC: use GFP_ATOMIC under spin lock.
Date: Thu, 22 Nov 2012 08:09:57 +0000	[thread overview]
Message-ID: <50ADDDD5.1080709@bfs.de> (raw)
In-Reply-To: <1353360842-18384-1-git-send-email-tipecaml@gmail.com>



Am 19.11.2012 22:34, schrieb Cyril Roelandt:
> Found using the following semantic patch:
> <spml>
> @@
> @@
> spin_lock_irqsave(...);
> ... when != spin_unlock_irqrestore(...);
> * GFP_KERNEL
> </spml>
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
>  drivers/usb/gadget/uvc_video.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
> index b0e53a8..79b4132 100644
> --- a/drivers/usb/gadget/uvc_video.c
> +++ b/drivers/usb/gadget/uvc_video.c
> @@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
>  		video->encode(req, video, buf);
>  
>  		/* Queue the USB request */
> -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> +		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
>  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
>  			usb_ep_set_halt(video->ep);
>  			spin_unlock_irqrestore(&video->queue.irqlock, flags);


IMHO, this should be two lines, aka:

ret = usb_ep_queue(video->ep, req, GFP_KERNEL);
if (ret<0)

just my two cents,

re,
 wh

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Cyril Roelandt <tipecaml@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org, balbi@ti.com,
	laurent.pinchart@ideasonboard.com,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] UVC: use GFP_ATOMIC under spin lock.
Date: Thu, 22 Nov 2012 09:09:57 +0100	[thread overview]
Message-ID: <50ADDDD5.1080709@bfs.de> (raw)
In-Reply-To: <1353360842-18384-1-git-send-email-tipecaml@gmail.com>



Am 19.11.2012 22:34, schrieb Cyril Roelandt:
> Found using the following semantic patch:
> <spml>
> @@
> @@
> spin_lock_irqsave(...);
> ... when != spin_unlock_irqrestore(...);
> * GFP_KERNEL
> </spml>
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
>  drivers/usb/gadget/uvc_video.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
> index b0e53a8..79b4132 100644
> --- a/drivers/usb/gadget/uvc_video.c
> +++ b/drivers/usb/gadget/uvc_video.c
> @@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
>  		video->encode(req, video, buf);
>  
>  		/* Queue the USB request */
> -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> +		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
>  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
>  			usb_ep_set_halt(video->ep);
>  			spin_unlock_irqrestore(&video->queue.irqlock, flags);


IMHO, this should be two lines, aka:

ret = usb_ep_queue(video->ep, req, GFP_KERNEL);
if (ret<0)

just my two cents,

re,
 wh

  reply	other threads:[~2012-11-22  8:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 21:34 [PATCH] UVC: use GFP_ATOMIC under spin lock Cyril Roelandt
2012-11-19 21:34 ` Cyril Roelandt
2012-11-22  8:09 ` walter harms [this message]
2012-11-22  8:09   ` walter harms
2012-11-22 12:22   ` Felipe Balbi
2012-11-22 12:22     ` Felipe Balbi
2012-11-22 12:38     ` Laurent Pinchart
2012-11-22 12:38       ` Laurent Pinchart
2012-11-25  1:58   ` [PATCH v2] " Cyril Roelandt
2012-11-25  1:58     ` Cyril Roelandt
2012-11-27 13:14     ` Laurent Pinchart
2012-11-27 13:14       ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50ADDDD5.1080709@bfs.de \
    --to=wharms@bfs.de \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tipecaml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.