From: coverity-bot <keescook@chromium.org>
To: Dragos Bogdan <dragos.bogdan@analog.com>
Cc: Beniamin Bia <beniamin.bia@analog.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org
Subject: Coverity: ad7476_probe(): Incorrect expression
Date: Fri, 24 Apr 2020 08:25:59 -0700 [thread overview]
Message-ID: <202004240825.C72A8C1A6@keescook> (raw)
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!
--
Coverity-bot
next reply other threads:[~2020-04-24 15:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 15:25 coverity-bot [this message]
2020-04-24 18:25 ` Coverity: ad7476_probe(): Incorrect expression Gustavo A. R. Silva
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=202004240825.C72A8C1A6@keescook \
--to=keescook@chromium.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=beniamin.bia@analog.com \
--cc=dragos.bogdan@analog.com \
--cc=gustavo@embeddedor.com \
--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