From: Hernán Gonzalez Date: Fri, 13 Apr 2018 16:36:40 +0000 (-0300) Subject: staging: iio: ad7746: Fix bound checkings X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2c973421648bc542c93aa9417a0de1e92f677248;p=openwrt%2Fstaging%2Fblogic.git staging: iio: ad7746: Fix bound checkings Also remove unnecessary parenthesis Signed-off-by: Hernán Gonzalez Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c index 5dad5d3c3efe..f53612a6461d 100644 --- a/drivers/staging/iio/cdc/ad7746.c +++ b/drivers/staging/iio/cdc/ad7746.c @@ -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; }