Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbaGGKqm (ORCPT ); Mon, 7 Jul 2014 06:46:42 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:58344 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752001AbaGGKqk (ORCPT ); Mon, 7 Jul 2014 06:46:40 -0400 Date: Mon, 7 Jul 2014 11:46:35 +0100 From: Lee Jones To: Rickard Strandqvist Cc: Jingoo Han , Bryan Wu , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used Message-ID: <20140707104635.GA6407@lee--X1> References: <1404670906-17335-1-git-send-email-rickard_strandqvist@spectrumdigital.se> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1404670906-17335-1-git-send-email-rickard_strandqvist@spectrumdigital.se> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Variable ar assigned a value that is never used. > I have also removed all the code that thereby serves no purpose. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/video/backlight/jornada720_lcd.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Solve it the other way around. Add a check and return the value if an error is returned. > diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c > index da3876c..b304319 100644 > --- a/drivers/video/backlight/jornada720_lcd.c > +++ b/drivers/video/backlight/jornada720_lcd.c > @@ -56,12 +56,10 @@ static int jornada_lcd_get_contrast(struct lcd_device *ld) > > static int jornada_lcd_set_contrast(struct lcd_device *ld, int value) > { > - int ret; > - > jornada_ssp_start(); > > /* start by sending our set contrast cmd to mcu */ > - ret = jornada_ssp_byte(SETCONTRAST); > + jornada_ssp_byte(SETCONTRAST); > > /* push the new value */ > if (jornada_ssp_byte(value) != TXDUMMY) { -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/