iio: adc: vf610: fix simple_return.cocci warnings
A message that is not in the archive (sent off-list or not yet received): 201509221047.gO4tovIe%[email protected]
A message that is not in the archive (sent off-list or not yet received): 20150922021648.GA28295@lkp-sb04
Jonathan Cameron
AppliedQuoted 9 lines · kbuild test robot
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.cocciCC Sanchayan Maity <[email protected]>Signed-off-by Fengguang Wu <[email protected]>
Applied to the togreg branch of iio.git.
Thanks,
Jonathan
Quoted 30 lines
---
vf610_adc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/iio/adc/vf610_adc.c +2
-6@@ -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(swritel (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 = {