From: Jonathan Cameron <jic23@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Eva Rachel Retuya <eraretuya@gmail.com>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: iio: cdc/ad7746: fix missing return value
Date: Tue, 25 Oct 2016 17:27:07 +0100 [thread overview]
Message-ID: <b19d0f7a-03c4-c4e6-dd8c-188012402530@kernel.org> (raw)
In-Reply-To: <20161025155646.64112-1-arnd@arndb.de>
On 25/10/16 16:56, Arnd Bergmann wrote:
> As found by "gcc -Wmaybe-uninitialized", the latest change to the
> driver lacked an initalization for the return code in one of the
> added cases:
>
> drivers/staging/iio/cdc/ad7746.c: In function ‘ad7746_read_raw’:
> drivers/staging/iio/cdc/ad7746.c:655:2: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> This sets it to IIO_VAL_INT, which I think is what we want here.
>
> Fixes: 2296c0623eb7 ("staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQ")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Gah, not a good bit of reviewing from me. Should have caught that one. Thanks Arnd.
Applied to the togreg branch of iio.git - initially pushed out as testing for the
autobuilders to play with it. Will probably be a little while before I send
another pull to Greg (most likely the weekend)
Thanks again,
Jonathan
> ---
> drivers/staging/iio/cdc/ad7746.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
> index f41251ceeacd..a5828f9aa437 100644
> --- a/drivers/staging/iio/cdc/ad7746.c
> +++ b/drivers/staging/iio/cdc/ad7746.c
> @@ -642,6 +642,7 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
> case IIO_VOLTAGE:
> *val = ad7746_vt_filter_rate_table[
> (chip->config >> 6) & 0x3][0];
> + ret = IIO_VAL_INT;
> break;
> default:
> ret = -EINVAL;
>
next prev parent reply other threads:[~2016-10-25 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 15:56 [PATCH] staging: iio: cdc/ad7746: fix missing return value Arnd Bergmann
2016-10-25 16:27 ` Jonathan Cameron [this message]
2016-10-26 9:48 ` Eva Rachel Retuya
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=b19d0f7a-03c4-c4e6-dd8c-188012402530@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=eraretuya@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).