staging: iio: ad7746: Fix bound checkings
authorHernán Gonzalez <hernan@vanguardiasur.com.ar>
Fri, 13 Apr 2018 16:36:40 +0000 (13:36 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Apr 2018 14:38:38 +0000 (15:38 +0100)
Also remove unnecessary parenthesis

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/cdc/ad7746.c

index 5dad5d3c3efe0d315142e7843d0704f7acb8a798..f53612a6461d653ce4858a03acbe8554f555bbd1 100644 (file)
@@ -457,7 +457,7 @@ static int ad7746_write_raw(struct iio_dev *indio_dev,
                ret = 0;
                break;
        case IIO_CHAN_INFO_CALIBBIAS:
-               if ((val < 0) | (val > 0xFFFF)) {
+               if (val < 0 || val > 0xFFFF) {
                        ret = -EINVAL;
                        goto out;
                }
@@ -469,7 +469,7 @@ static int ad7746_write_raw(struct iio_dev *indio_dev,
                ret = 0;
                break;
        case IIO_CHAN_INFO_OFFSET:
-               if ((val < 0) | (val > 43008000)) { /* 21pF */
+               if (val < 0 || val > 43008000) { /* 21pF */
                        ret = -EINVAL;
                        goto out;
                }