Re: [PATCH 17/18] backlight: jornada720: remove 'else' after a return

Jingoo Han
2014-08-27T00:38:02Z

On Wednesday, August 27, 2014 1:28 AM, Lee Jones wrote:
> On Tue, 26 Aug 2014, Jingoo Han wrote:
>
> > Fixed the following checkpatch warning.
> >
> > WARNING: else is not generally useful after a break or return
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> > drivers/video/backlight/jornada720_lcd.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c
> > index 228bc319de19..1cf3d59f1e7f 100644
> > --- a/drivers/video/backlight/jornada720_lcd.c
> > +++ b/drivers/video/backlight/jornada720_lcd.c
> > @@ -30,8 +30,8 @@ static int jornada_lcd_get_power(struct lcd_device *ld)
> > /* LDD2 in PPC = LCD POWER */
> > if (PPSR & PPC_LDD2)
> > return FB_BLANK_UNBLANK; /* PW ON */
> > - else
> > - return FB_BLANK_POWERDOWN; /* PW OFF */
> > +
> > + return FB_BLANK_POWERDOWN; /* PW OFF */
>
> How about:
>
> return PPSR & PPC_LDD2 ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;

OK, it looks good.
Thank you for your suggestion!

Best regards,
Jingoo Han

>
> > }
> >
> > static int jornada_lcd_get_contrast(struct lcd_device *ld)
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog