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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ebda26c.346.18404df6852.Coremail.wangkailong@jari.cn>
Date:   Sun, 23 Oct 2022 20:44:20 +0800 (GMT+08:00)
From:   "KaiLong Wang" <wangkailong@...i.cn>
To:     mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu,
        farosas@...ux.ibm.com, mirq-linux@...e.qmqm.pl,
        dmitry.osipenko@...labora.com, kda@...ux-powerpc.org,
        naveen.n.rao@...ux.vnet.ibm.com
Cc:     linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject:  [PATCH] powerpc: replace ternary operator with min()

Fix the following coccicheck warning:

arch/powerpc/xmon/xmon.c:2987: WARNING opportunity for min()
arch/powerpc/xmon/xmon.c:2583: WARNING opportunity for min()

Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
---
 arch/powerpc/xmon/xmon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index f51c882bf902..a7751cd2cc9d 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2580,7 +2580,7 @@ static void xmon_rawdump (unsigned long adrs, long ndump)
 	unsigned char temp[16];
 
 	for (n = ndump; n > 0;) {
-		r = n < 16? n: 16;
+		r = min(n, 16);
 		nr = mread(adrs, temp, r);
 		adrs += nr;
 		for (m = 0; m < r; ++m) {
@@ -2984,7 +2984,7 @@ prdump(unsigned long adrs, long ndump)
 	for (n = ndump; n > 0;) {
 		printf(REG, adrs);
 		putchar(' ');
-		r = n < 16? n: 16;
+		r = min(n, 16);
 		nr = mread(adrs, temp, r);
 		adrs += nr;
 		for (m = 0; m < r; ++m) {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ