From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
kbuild-all@01.org, Felipe Balbi <balbi@ti.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: Tue, 22 Nov 2016 19:27:09 +0200 [thread overview]
Message-ID: <2122146.rzc0RNY0pB@avalon> (raw)
In-Reply-To: <55FAA16C.5070601@samsung.com>
Hi Andrzej and Julia,
Could one of you please submit a patch to fix this ?
On Thursday 17 Sep 2015 13:18:04 Andrzej Pietrasiewicz wrote:
> Hi Julia,
>
> W dniu 17.09.2015 o 10:57, Julia Lawall pisze:
> > Coccinelle suggests the following patch. But the code is curious. Is the
> > function expected to always return a failure value?
>
> Thank you for catching this. The function is not expected to always
> return a failure value. Fortunately it does not matter anyway because
> the return value of the drop_link() operation is silently ignored by
> its caller in fs/configfs/symlink.c, functions configfs_symlink()
> and configfs_unlink(). For my comments see inline.
>
> > 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;
>
> return 0;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2016-11-22 17:26 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 ` [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings Julia Lawall
2015-09-17 11:18 ` Andrzej Pietrasiewicz
2015-09-17 11:30 ` SF Markus Elfring
2016-11-22 17:27 ` Laurent Pinchart [this message]
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=2122146.rzc0RNY0pB@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=andrzej.p@samsung.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=kbuild-all@01.org \
--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