[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180415160550.4705667e@archlinux>
Date: Sun, 15 Apr 2018 16:05:50 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Hernán Gonzalez <hernan@...guardiasur.com.ar>
Cc: knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
gregkh@...uxfoundation.org, Michael.Hennerich@...log.com,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 03/14] staging: iio: ad7746: Fix bound checkings
On Fri, 13 Apr 2018 13:36:40 -0300
Hernán Gonzalez <hernan@...guardiasur.com.ar> wrote:
> Also remove unnecessary parenthesis
I am probably missing something. I'm not sure what you mean
by fix bound checking? There are superfluous brackets, but
I don't see any functional change to indicate there was anything
wrong with the original checks.
>
> Signed-off-by: Hernán Gonzalez <hernan@...guardiasur.com.ar>
> ---
> 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 516aa93..d793785 100644
> --- a/drivers/staging/iio/cdc/ad7746.c
> +++ b/drivers/staging/iio/cdc/ad7746.c
> @@ -458,7 +458,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;
> }
> @@ -470,7 +470,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;
> }
Powered by blists - more mailing lists