summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/max1027.c
diff options
context:
space:
mode:
authorSandhya Bankar <bankarsandhya512@gmail.com>2016-09-23 23:04:48 +0300
committerJonathan Cameron <jic23@kernel.org>2016-09-24 19:12:13 +0300
commit58b90a8d2c397ab8498d1b2a610e6ae40b6ad0f6 (patch)
tree82cc009aab07e7c45bd7b199f08ddcf01bbbc482 /drivers/iio/adc/max1027.c
parent057ac1acdfc4743f066fcefe359385cad00549eb (diff)
downloadlinux-58b90a8d2c397ab8498d1b2a610e6ae40b6ad0f6.tar.xz
drivers: iio: max1027: Fix sparse warning: "dubious: x | !y"
Fixing below warning: drivers/iio/adc/max1027.c:241:34: warning: dubious: x | !y . Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/max1027.c')
-rw-r--r--drivers/iio/adc/max1027.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 712fbd2b1f16..d60181822833 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -238,7 +238,9 @@ static int max1027_read_single_value(struct iio_dev *indio_dev,
/* Configure conversion register with the requested chan */
st->reg = MAX1027_CONV_REG | MAX1027_CHAN(chan->channel) |
- MAX1027_NOSCAN | !!(chan->type == IIO_TEMP);
+ MAX1027_NOSCAN;
+ if (chan->type == IIO_TEMP)
+ st->reg |= MAX1027_TEMP;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev,