staging: iio: ad7746: Fix bound checkings

Also remove unnecessary parenthesis

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Hernán Gonzalez 2018-04-13 13:36:40 -03:00 committed by Jonathan Cameron
parent da2d54494c
commit 2c97342164

View 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;
}