From: Lee Jones <lee.jones@linaro.org>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jingoo Han <jg1.han@samsung.com>, Bryan Wu <cooloney@gmail.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
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
Date: Mon, 07 Jul 2014 10:46:35 +0000 [thread overview]
Message-ID: <20140707104635.GA6407@lee--X1> (raw)
In-Reply-To: <1404670906-17335-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Jingoo Han <jg1.han@samsung.com>, Bryan Wu <cooloney@gmail.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
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
Date: Mon, 7 Jul 2014 11:46:35 +0100 [thread overview]
Message-ID: <20140707104635.GA6407@lee--X1> (raw)
In-Reply-To: <1404670906-17335-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
> 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
next prev parent reply other threads:[~2014-07-07 10:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-05 12:12 [PATCH] video: backlight: jornada720_lcd.c: Cleaning up variable that is never used Rickard Strandqvist
2014-07-05 12:12 ` Rickard Strandqvist
2014-07-06 18:21 ` Rickard Strandqvist
2014-07-06 18:21 ` Rickard Strandqvist
2014-07-07 10:46 ` Lee Jones [this message]
2014-07-07 10:46 ` Lee Jones
2014-07-07 20:00 ` Rickard Strandqvist
2014-07-07 20:00 ` Rickard Strandqvist
2014-07-07 10:50 ` Lee Jones
2014-07-07 10:50 ` Lee Jones
2014-07-07 20:01 ` Rickard Strandqvist
2014-07-07 20:01 ` Rickard Strandqvist
2014-07-09 16:30 ` Lee Jones
2014-07-09 16:30 ` Lee Jones
2014-07-09 22:08 ` Rickard Strandqvist
2014-07-09 22:08 ` Rickard Strandqvist
2014-07-10 2:28 ` Jingoo Han
2014-07-10 2:28 ` Jingoo Han
2014-07-10 7:40 ` Lee Jones
2014-07-10 7:40 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140707104635.GA6407@lee--X1 \
--to=lee.jones@linaro.org \
--cc=cooloney@gmail.com \
--cc=jg1.han@samsung.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.