From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933288AbcKVR0y (ORCPT ); Tue, 22 Nov 2016 12:26:54 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:47740 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933193AbcKVR0v (ORCPT ); Tue, 22 Nov 2016 12:26:51 -0500 From: Laurent Pinchart To: Andrzej Pietrasiewicz Cc: Julia Lawall , kbuild-all@01.org, Felipe Balbi , Greg Kroah-Hartman , 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 Message-ID: <2122146.rzc0RNY0pB@avalon> User-Agent: KMail/4.14.10 (Linux/4.8.6-gentoo; KDE/4.14.24; x86_64; ; ) In-Reply-To: <55FAA16C.5070601@samsung.com> References: <201509170828.xv0cYNA5%fengguang.wu@intel.com> <55FAA16C.5070601@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >> CC: kbuild-all@01.org > >> CC: Felipe Balbi > >> CC: Laurent Pinchart > >> CC: "Greg Kroah-Hartman" > >> 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 > >> Signed-off-by: Fengguang Wu > >> --- > >> > >> 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