lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221113130306.517e7aa3@jic23-huawei>
Date:   Sun, 13 Nov 2022 13:03:06 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Deepak R Varma <drv@...lo.com>
Cc:     Lars-Peter Clausen <lars@...afoo.de>,
        Michael Hennerich <Michael.Hennerich@...log.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-iio@...r.kernel.org, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: iio: meter: replace ternary operator by if
 condition

On Sun, 13 Nov 2022 10:58:20 +0530
Deepak R Varma <drv@...lo.com> wrote:

> Replace ternary operator by simple if based evaluation of the return
> value. Issue identified using coccicheck.
> 
> Signed-off-by: Deepak R Varma <drv@...lo.com>

Applied to the togreg branch of iio.git and pushed out as testing to
see if 0-day can find anything we missed.

Thanks,

Jonathan

> ---
> 
> Changes in v2:
>    1. Use if based evaluation instead of using min macro
>       suggested by Joe Perches.
> 
> 
>  drivers/staging/iio/meter/ade7854-i2c.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c
> index a9a06e8dda51..71b67dd3c8e9 100644
> --- a/drivers/staging/iio/meter/ade7854-i2c.c
> +++ b/drivers/staging/iio/meter/ade7854-i2c.c
> @@ -61,7 +61,10 @@ static int ade7854_i2c_write_reg(struct device *dev,
>  unlock:
>  	mutex_unlock(&st->buf_lock);
> 
> -	return ret < 0 ? ret : 0;
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
>  }
> 
>  static int ade7854_i2c_read_reg(struct device *dev,
> --
> 2.34.1
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ