From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Matt Ranostay <mranostay@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] iio: light: apds9960: silence uninitialized variable warning
Date: Sat, 23 Apr 2016 22:18:38 +0100 [thread overview]
Message-ID: <9772b4fa-8a26-9ddd-7a16-c6f404cccbc1@kernel.org> (raw)
In-Reply-To: <20160422100414.GG11398@mwanda>
On 22/04/16 11:04, Dan Carpenter wrote:
> It causes a static checker warning if we use "buf" on the failure path
> so move that inside the if statement.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to the togreg branch of iio.git,
Thanks,
Jonathan
>
> diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
> index a6af56a..fbdd172 100644
> --- a/drivers/iio/light/apds9960.c
> +++ b/drivers/iio/light/apds9960.c
> @@ -491,9 +491,10 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
> case IIO_INTENSITY:
> ret = regmap_bulk_read(data->regmap, chan->address,
> &buf, 2);
> - if (!ret)
> + if (!ret) {
> ret = IIO_VAL_INT;
> - *val = le16_to_cpu(buf);
> + *val = le16_to_cpu(buf);
> + }
> break;
> default:
> ret = -EINVAL;
>
prev parent reply other threads:[~2016-04-23 21:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 10:04 [patch] iio: light: apds9960: silence uninitialized variable warning Dan Carpenter
2016-04-23 21:18 ` Jonathan Cameron [this message]
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=9772b4fa-8a26-9ddd-7a16-c6f404cccbc1@kernel.org \
--to=jic23@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mranostay@gmail.com \
--cc=pmeerw@pmeerw.net \
/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