From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: coverity-bot <keescook@chromium.org>,
Dragos Bogdan <dragos.bogdan@analog.com>
Cc: Beniamin Bia <beniamin.bia@analog.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-next@vger.kernel.org
Subject: Re: Coverity: ad7476_probe(): Incorrect expression
Date: Fri, 24 Apr 2020 13:25:28 -0500 [thread overview]
Message-ID: <bc2a38b9-3a3d-d95b-8bc9-e4842070088a@embeddedor.com> (raw)
In-Reply-To: <202004240825.C72A8C1A6@keescook>
This one has already been addressed by Colin:
https://lore.kernel.org/lkml/20200424130419.22940-1-colin.king@canonical.com/
--
Gustavo
On 4/24/20 10:25, coverity-bot wrote:
> Hello!
>
> This is an experimental semi-automated report about issues detected by
> Coverity from a scan of next-20200424 as part of the linux-next scan project:
> https://scan.coverity.com/projects/linux-next-weekly-scan
>
> You're getting this email because you were associated with the identified
> lines of code (noted below) that were touched by commits:
>
> Wed Mar 11 10:43:26 2020 +0200
> 3a6af93dd66e ("iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R")
>
> Coverity reported the following:
>
> *** CID 1492717: Incorrect expression (NO_EFFECT)
> /drivers/iio/adc/ad7476.c: 312 in ad7476_probe()
> 306 indio_dev->name = spi_get_device_id(spi)->name;
> 307 indio_dev->modes = INDIO_DIRECT_MODE;
> 308 indio_dev->channels = st->chip_info->channel;
> 309 indio_dev->num_channels = 2;
> 310 indio_dev->info = &ad7476_info;
> 311
> vvv CID 1492717: Incorrect expression (NO_EFFECT)
> vvv Comparing an array to null is not useful: "st->chip_info->convst_channel", since the test will always evaluate as true.
> 312 if (st->convst_gpio && st->chip_info->convst_channel)
> 313 indio_dev->channels = st->chip_info->convst_channel;
> 314 /* Setup default message */
> 315
> 316 st->xfer.rx_buf = &st->data;
> 317 st->xfer.len = st->chip_info->channel[0].scan_type.storagebits / 8;
>
> If this is a false positive, please let us know so we can mark it as
> such, or teach the Coverity rules to be smarter. If not, please make
> sure fixes get into linux-next. :) For patches fixing this, please
> include these lines (but double-check the "Fixes" first):
>
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1492717 ("Incorrect expression")
> Fixes: 3a6af93dd66e ("iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R")
>
> Thanks for your attention!
>
prev parent reply other threads:[~2020-04-24 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 15:25 Coverity: ad7476_probe(): Incorrect expression coverity-bot
2020-04-24 18:25 ` Gustavo A. R. Silva [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=bc2a38b9-3a3d-d95b-8bc9-e4842070088a@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=beniamin.bia@analog.com \
--cc=dragos.bogdan@analog.com \
--cc=keescook@chromium.org \
--cc=linux-next@vger.kernel.org \
/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