From: Julia Lawall <julia.lawall@lip6.fr>
To: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Cc: kbuild-all@01.org, Felipe Balbi <balbi@ti.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings
Date: Thu, 17 Sep 2015 10:57:59 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1509171056470.2399@hadrien> (raw)
In-Reply-To: <20150917000130.GA25134@lkp-ib04>
Coccinelle suggests the following patch. But the code is curious. Is the
function expected to always return a failure value?
thanks,
julia
On Thu, 17 Sep 2015, kbuild test robot wrote:
> TO: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
> CC: kbuild-all@01.org
> CC: Felipe Balbi <balbi@ti.com>
> CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
> CC: linux-usb@vger.kernel.org
> CC: linux-kernel@vger.kernel.org
>
> drivers/usb/gadget/function/uvc_configfs.c:866:5-8: Unneeded variable: "ret". Return "- EINVAL" on line 891
>
>
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> CC: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
> Please take the patch only if it's a positive warning. Thanks!
>
> uvc_configfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -863,7 +863,6 @@ static int uvcg_streaming_header_drop_li
> struct uvcg_streaming_header *src_hdr;
> struct uvcg_format *target_fmt = NULL;
> struct uvcg_format_ptr *format_ptr, *tmp;
> - int ret = -EINVAL;
>
> src_hdr = to_uvcg_streaming_header(src);
> mutex_lock(su_mutex); /* for navigating configfs hierarchy */
> @@ -888,7 +887,7 @@ static int uvcg_streaming_header_drop_li
> out:
> mutex_unlock(&opts->lock);
> mutex_unlock(su_mutex);
> - return ret;
> + return -EINVAL;
>
> }
>
>
next parent reply other threads:[~2015-09-17 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201509170828.xv0cYNA5%fengguang.wu@intel.com>
[not found] ` <20150917000130.GA25134@lkp-ib04>
2015-09-17 8:57 ` Julia Lawall [this message]
2015-09-17 11:18 ` [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings Andrzej Pietrasiewicz
2015-09-17 11:30 ` SF Markus Elfring
2016-11-22 17:27 ` Laurent Pinchart
2016-11-23 8:35 ` Andrzej Pietrasiewicz
2016-11-28 8:28 ` Christoph Hellwig
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=alpine.DEB.2.10.1509171056470.2399@hadrien \
--to=julia.lawall@lip6.fr \
--cc=andrzej.p@samsung.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@01.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox