linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 1/3] video: backlight: adp5520: fix compiler warning in adp5520_show
Date: Mon, 11 Mar 2013 00:56:49 +0000	[thread overview]
Message-ID: <004e01ce1df3$4fc4d080$ef4e7180$%han@samsung.com> (raw)
In-Reply-To: <1362771069-16345-1-git-send-email-devendra.aaru@gmail.com>

On Saturday, March 09, 2013 4:31 AM, Devendra Naga wrote:
> 
> while compiling with make W=1 (gcc gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8))
> 
> found the following warning
> 
> drivers/video/backlight/adp5520_bl.c: In function ‘adp5520_show’:
> drivers/video/backlight/adp5520_bl.c:146:6: warning: variable ‘error’ set but not used [-Wunused-but-
> set-variable]
> 
> fixed by removing the variable
> 
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> 
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
> ---
>  drivers/video/backlight/adp5520_bl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
> index a1e41d4..9f8b20b 100644
> --- a/drivers/video/backlight/adp5520_bl.c
> +++ b/drivers/video/backlight/adp5520_bl.c
> @@ -143,11 +143,10 @@ static int adp5520_bl_setup(struct backlight_device *bl)
>  static ssize_t adp5520_show(struct device *dev, char *buf, int reg)
>  {
>  	struct adp5520_bl *data = dev_get_drvdata(dev);
> -	int error;
>  	uint8_t reg_val;
> 
>  	mutex_lock(&data->lock);
> -	error = adp5520_read(data->master, reg, &reg_val);
> +	adp5520_read(data->master, reg, &reg_val);
>  	mutex_unlock(&data->lock);

Hi Devendra Naga,

I also agree with Andrew Morton's opinion.
It would be better to check return value from I2C read/write functions.

Best regards,
Jingoo Han

> 
>  	return sprintf(buf, "%u\n", reg_val);
> --
> 1.8.1.2


  parent reply	other threads:[~2013-03-11  0:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 19:31 [PATCH 1/3] video: backlight: adp5520: fix compiler warning in adp5520_show Devendra Naga
2013-03-08 21:01 ` Andrew Morton
2013-03-11  0:56 ` Jingoo Han [this message]
2013-03-11  6:16 ` devendra.aaru
2013-03-11  6:18 ` devendra.aaru

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='004e01ce1df3$4fc4d080$ef4e7180$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).