Return-Path: Received: from saturn.retrosnub.co.uk ([178.18.118.26]:42362 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbIWTCt (ORCPT ); Wed, 23 Sep 2015 15:02:49 -0400 Subject: Re: [PATCH] iio: adc: vf610: fix simple_return.cocci warnings To: kbuild test robot , Sanchayan Maity References: <201509221047.gO4tovIe%fengguang.wu@intel.com> <20150922021648.GA28295@lkp-sb04> Cc: kbuild-all@01.org, Jonathan Cameron , "linux-iio@vger.kernel.org" From: Jonathan Cameron Message-ID: <5602F755.1030100@jic23.retrosnub.co.uk> Date: Wed, 23 Sep 2015 20:02:45 +0100 MIME-Version: 1.0 In-Reply-To: <20150922021648.GA28295@lkp-sb04> Content-Type: text/plain; charset=windows-1252 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 22/09/15 03:16, kbuild test robot wrote: > drivers/iio/adc/vf610_adc.c:766:1-4: WARNING: end returns can be simpified and declaration on line 755 can be dropped > > Simplify a trivial if-return sequence. Possibly combine with a > preceding function call. > > Generated by: scripts/coccinelle/misc/simple_return.cocci > > CC: Sanchayan Maity > Signed-off-by: Fengguang Wu Applied to the togreg branch of iio.git. Thanks, Jonathan > --- > > vf610_adc.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > --- a/drivers/iio/adc/vf610_adc.c > +++ b/drivers/iio/adc/vf610_adc.c > @@ -752,7 +752,7 @@ static int vf610_adc_buffer_predisable(s > { > struct vf610_adc *info = iio_priv(indio_dev); > unsigned int hc_cfg = 0; > - int val, ret; > + int val; > > val = readl(info->regs + VF610_REG_ADC_GC); > val &= ~VF610_ADC_ADCON; > @@ -763,11 +763,7 @@ static int vf610_adc_buffer_predisable(s > > writel(hc_cfg, info->regs + VF610_REG_ADC_HC0); > > - ret = iio_triggered_buffer_predisable(indio_dev); > - if (ret) > - return ret; > - > - return 0; > + return iio_triggered_buffer_predisable(indio_dev); > } > > static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = { >