From: Eva Rachel Retuya <eraretuya@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
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: Wed, 26 Oct 2016 17:48:44 +0800 [thread overview]
Message-ID: <20161026094839.GA2243@Socrates-DK> (raw)
In-Reply-To: <b19d0f7a-03c4-c4e6-dd8c-188012402530@kernel.org>
On Tue, Oct 25, 2016 at 05:27:07PM +0100, Jonathan Cameron wrote:
> 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.
>
It's not your fault. My apologies. v1 of this patch is OK, I just happen to
encounter a problem and had to rework the v2 on another branch resulting
to this blunder.
I will be extra careful next time.
Eva
> 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;
> >
>
prev parent reply other threads:[~2016-10-26 9:48 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
2016-10-26 9:48 ` Eva Rachel Retuya [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=20161026094839.GA2243@Socrates-DK \
--to=eraretuya@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.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).