From: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
To: "dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
"Bogdan, Dragos" <Dragos.Bogdan@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [bug report] iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R
Date: Fri, 1 May 2020 10:11:49 +0000 [thread overview]
Message-ID: <bb2386ea4b011e2475f19f4169fce3bea5d9fa7e.camel@analog.com> (raw)
In-Reply-To: <20200501094449.GA960353@mwanda>
On Fri, 2020-05-01 at 12:44 +0300, Dan Carpenter wrote:
> [External]
>
> Hello Dragos Bogdan,
>
> The patch 3a6af93dd66e: "iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for
> AD7091R" from Mar 11, 2020, leads to the following static checker
> warning:
>
> drivers/iio/adc/ad7476.c:312 ad7476_probe()
> warn: this array is non-NULL. 'st->chip_info->convst_channel'
>
> drivers/iio/adc/ad7476.c
> 288 ret = devm_add_action_or_reset(&spi->dev, ad7476_reg_disable,
> 289 st);
> 290 if (ret)
> 291 return ret;
> 292
> 293 st->convst_gpio = devm_gpiod_get_optional(&spi->dev,
> 294 "adi,conversion-
> start",
> 295 GPIOD_OUT_LOW);
> 296 if (IS_ERR(st->convst_gpio))
> 297 return PTR_ERR(st->convst_gpio);
> 298
> 299 spi_set_drvdata(spi, indio_dev);
> 300
> 301 st->spi = spi;
> 302
> 303 /* Establish that the iio_dev is a child of the spi device */
> 304 indio_dev->dev.parent = &spi->dev;
> 305 indio_dev->dev.of_node = spi->dev.of_node;
> 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
> 312 if (st->convst_gpio && st->chip_info->convst_channel)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is an array, not a pointer and it it's in the middle of the struct
> so it can't possibly be NULL.
I think there's already a patch applied for this.
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=4d22ab7446c69f7ebbc8c8a486ebd9aba68823c0
>
> 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;
> 318
> 319 spi_message_init(&st->msg);
> 320 spi_message_add_tail(&st->xfer, &st->msg);
> 321
>
> regards,
> dan carpenter
prev parent reply other threads:[~2020-05-01 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 9:44 [bug report] iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R Dan Carpenter
2020-05-01 10:11 ` Ardelean, Alexandru [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=bb2386ea4b011e2475f19f4169fce3bea5d9fa7e.camel@analog.com \
--to=alexandru.ardelean@analog.com \
--cc=Dragos.Bogdan@analog.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-iio@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