public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
To: Julia Lawall <julia.lawall@lip6.fr>
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 13:18:04 +0200	[thread overview]
Message-ID: <55FAA16C.5070601@samsung.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1509171056470.2399@hadrien>

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;


Thanks,

AP

  reply	other threads:[~2015-09-17 11:18 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 [this message]
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=55FAA16C.5070601@samsung.com \
    --to=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@lip6.fr \
    --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