Commit 2c973421 authored by Hernán Gonzalez's avatar Hernán Gonzalez Committed by Jonathan Cameron

staging: iio: ad7746: Fix bound checkings

Also remove unnecessary parenthesis
Signed-off-by: default avatarHernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent da2d5449
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment