Commit a66904b2 authored by Colin Ian King's avatar Colin Ian King Committed by Jonathan Cameron

iio: adc: ad7476: remove redundant null check on an array

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.

Addresses-Coverity: ("Array compared against 0")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ff3f7e04
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment