From: Jonathan Cameron <jic23@kernel.org>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
Cc: "lars@metafoo.de" <lars@metafoo.de>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"Bogdan, Dragos" <Dragos.Bogdan@analog.com>,
"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
"knaack.h@gmx.de" <knaack.h@gmx.de>,
"colin.king@canonical.com" <colin.king@canonical.com>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] iio: adc: ad7476: remove redundant null check on an array
Date: Sat, 25 Apr 2020 18:01:10 +0100 [thread overview]
Message-ID: <20200425180110.3ffa5696@archlinux> (raw)
In-Reply-To: <f2c6d3f3f8f884e87f1c9895fe99b77e8f4c1e3e.camel@analog.com>
On Fri, 24 Apr 2020 15:01:26 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Fri, 2020-04-24 at 14:04 +0100, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > The null check on st->chip_info->convst_channel is redundant because
> > convst_channel is a 2 element array of struct iio_chan_spec objects
> > and this can never be null. Fix this by removing the null check.
> >
>
> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing.
I didn't take this as a fix as it's not doing any harm in the meantime
whilst this patch goes the slow route.
Thanks,
Jonathan
>
> > Addresses-Coverity: ("Array compared against 0")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> > drivers/iio/adc/ad7476.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
> > index e9984a38fc4c..4e816d714ad2 100644
> > --- a/drivers/iio/adc/ad7476.c
> > +++ b/drivers/iio/adc/ad7476.c
> > @@ -309,7 +309,7 @@ static int ad7476_probe(struct spi_device *spi)
> > indio_dev->num_channels = 2;
> > indio_dev->info = &ad7476_info;
> >
> > - if (st->convst_gpio && st->chip_info->convst_channel)
> > + if (st->convst_gpio)
> > indio_dev->channels = st->chip_info->convst_channel;
> > /* Setup default message */
> >
next prev parent reply other threads:[~2020-04-25 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 13:04 [PATCH][next] iio: adc: ad7476: remove redundant null check on an array Colin King
2020-04-24 15:01 ` Ardelean, Alexandru
2020-04-25 17:01 ` Jonathan Cameron [this message]
2020-04-25 17:02 ` Jonathan Cameron
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=20200425180110.3ffa5696@archlinux \
--to=jic23@kernel.org \
--cc=Dragos.Bogdan@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=alexandru.Ardelean@analog.com \
--cc=colin.king@canonical.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=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).