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-next>] [day] [month] [year] [list]
Message-Id: <20250828122843.48722-1-liaoyuanhong@vivo.com>
Date: Thu, 28 Aug 2025 20:28:43 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: Philipp Zabel <p.zabel@...gutronix.de>,
	linux-kernel@...r.kernel.org (open list)
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH] reset: canaan: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. 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);
 		break;
 	case RST_TYPE_CPU0:
 	case RST_TYPE_FLUSH:
@@ -249,7 +249,7 @@ static int k230_rst_deassert(struct reset_controller_dev *rcdev,
 		break;
 	case RST_TYPE_SW_DONE:
 		k230_rst_update(rstc, id, false, false,
-				id == RST_SPI2AXI ? false : true);
+				id != RST_SPI2AXI);
 		break;
 	case RST_TYPE_CPU0:
 	case RST_TYPE_FLUSH:
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ