]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drivers: iio: max1027: Fix sparse warning: "dubious: x | !y"
authorSandhya Bankar <bankarsandhya512@gmail.com>
Fri, 23 Sep 2016 20:04:48 +0000 (01:34 +0530)
committerJonathan Cameron <jic23@kernel.org>
Sat, 24 Sep 2016 16:12:13 +0000 (17:12 +0100)
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>
drivers/iio/adc/max1027.c

index 712fbd2b1f16259d9027a74404c0278858f58368..d60181822833093511a01311191be5ee7ae980a1 100644 (file)
@@ -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,