lkml.org 
[lkml]   [2014]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used
> 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 <rickard_strandqvist@spectrumdigital.se>
> ---
> 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/

\
 
 \ /
  Last update: 2014-07-07 13:21    [W:0.040 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site