lkml.org 
[lkml]   [2019]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3.16 29/87] staging: iio: cdc: Don't put an else right after a return
From
Date
On Wed, 2019-10-02 at 14:36 -0700, Joe Perches wrote:
> On Wed, 2019-10-02 at 20:06 +0100, Ben Hutchings wrote:
> > 3.16.75-rc1 review patch. If anyone has any objections, please let me know.
>
> This doesn't look necessary.

It allows the next patch to apply cleanly.

Ben.

> > ------------------
> >
> > From: Catalina Mocanu <catalina.mocanu@gmail.com>
> >
> > commit 288903f6b91e759b0a813219acd376426cbb8f14 upstream.
> >
> > This fixes the following checkpatch.pl warning:
> > WARNING: else is not generally useful after a break or return.
> >
> > While at it, remove new line for symmetry with the rest of the code.
> >
> > Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > drivers/staging/iio/cdc/ad7150.c | 10 +++-------
> > 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > --- a/drivers/staging/iio/cdc/ad7150.c
> > +++ b/drivers/staging/iio/cdc/ad7150.c
> > @@ -143,19 +143,15 @@ static int ad7150_read_event_config(stru
> > case IIO_EV_TYPE_MAG_ADAPTIVE:
> > if (dir == IIO_EV_DIR_RISING)
> > return adaptive && (threshtype == 0x1);
> > - else
> > - return adaptive && (threshtype == 0x0);
> > + return adaptive && (threshtype == 0x0);
> > case IIO_EV_TYPE_THRESH_ADAPTIVE:
> > if (dir == IIO_EV_DIR_RISING)
> > return adaptive && (threshtype == 0x3);
> > - else
> > - return adaptive && (threshtype == 0x2);
> > -
> > + return adaptive && (threshtype == 0x2);
> > case IIO_EV_TYPE_THRESH:
> > if (dir == IIO_EV_DIR_RISING)
> > return !adaptive && (threshtype == 0x1);
> > - else
> > - return !adaptive && (threshtype == 0x0);
> > + return !adaptive && (threshtype == 0x0);
> > default:
> > break;
> > }
> >
--
Ben Hutchings
Unix is many things to many people,
but it's never been everything to anybody.


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-10-03 16:48    [W:0.117 / U:4.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site