mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
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:
parent
da2d54494c
commit
2c97342164
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user