From 2c973421648bc542c93aa9417a0de1e92f677248 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hern=C3=A1n=20Gonzalez?= Date: Fri, 13 Apr 2018 13:36:40 -0300 Subject: [PATCH] staging: iio: ad7746: Fix bound checkings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also remove unnecessary parenthesis Signed-off-by: Hernán Gonzalez Signed-off-by: Jonathan Cameron --- drivers/staging/iio/cdc/ad7746.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.30.2