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: <eca2aee2cc628a4a67b39c284c1be643592c1905.camel@pengutronix.de>
Date: Thu, 28 Aug 2025 15:10:12 +0200
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Liao Yuanhong <liaoyuanhong@...o.com>, open list
	 <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] reset: canaan: Remove redundant ternary operators

On Do, 2025-08-28 at 20:28 +0800, Liao Yuanhong wrote:
> For ternary operators in the form of "a ? true : false", if 'a' itself
> returns a boolean result, the ternary operator can be omitted.

Here you are replacing "a ? false : true" with "!a", though.

> Remove
> redundant ternary operators to clean up the code.
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
> ---
>  drivers/reset/reset-k230.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/reset/reset-k230.c b/drivers/reset/reset-k230.c
> index c81045bb4a14..2eb16aac60c0 100644
> --- a/drivers/reset/reset-k230.c
> +++ b/drivers/reset/reset-k230.c
> @@ -218,7 +218,7 @@ static int k230_rst_assert(struct reset_controller_dev *rcdev, unsigned long id)
>  		break;
>  	case RST_TYPE_SW_DONE:
>  		k230_rst_update(rstc, id, true, false,
> -				id == RST_SPI2AXI ? false : true);
> +				id != RST_SPI2AXI);

Remove the line break. The line is short enough. Same for the other
occurrence.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ