lkml.org 
[lkml]   [2015]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings
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;
>
> }
>
>


\
 
 \ /
  Last update: 2015-09-17 11:21    [W:0.732 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site