From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk> 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:02:43 +0100 [thread overview] Message-ID: <20200425180243.18ff7f13@archlinux> (raw) In-Reply-To: <20200425180110.3ffa5696@archlinux> On Sat, 25 Apr 2020 18:01:10 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > 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. Just noticed this is in next only currently! Hence can definitely got he slow route as doesn't apply to mainline :) Jonathan > > 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 */ > > > >
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk> 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 17:02:43 +0000 [thread overview] Message-ID: <20200425180243.18ff7f13@archlinux> (raw) In-Reply-To: <20200425180110.3ffa5696@archlinux> On Sat, 25 Apr 2020 18:01:10 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > 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. Just noticed this is in next only currently! Hence can definitely got he slow route as doesn't apply to mainline :) Jonathan > > 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:02 UTC|newest] Thread overview: 8+ 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 13:04 ` Colin King 2020-04-24 15:01 ` Ardelean, Alexandru 2020-04-24 15:01 ` Ardelean, Alexandru 2020-04-25 17:01 ` Jonathan Cameron 2020-04-25 17:01 ` Jonathan Cameron 2020-04-25 17:02 ` 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=20200425180243.18ff7f13@archlinux \ --to=jic23@jic23.retrosnub.co.uk \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.