summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/ad7476.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-04-24 16:04:19 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-05-03 11:47:21 +0300
commita66904b209b6d828f9ad4486f30e24fb3463c71c (patch)
tree313ce10e0bcdd4024681aae7f9265f6afb417eea /drivers/iio/adc/ad7476.c
parentff3f7e049aef9202deeb2c67cfe7da819846dba1 (diff)
downloadlinux-a66904b209b6d828f9ad4486f30e24fb3463c71c.tar.xz
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: Colin Ian King <colin.king@canonical.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ad7476.c')
-rw-r--r--drivers/iio/adc/ad7476.c2
1 files changed, 1 insertions, 1 deletions
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 */