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: <20240624062411.321995-2-thorsten.blum@toblux.com>
Date: Mon, 24 Jun 2024 08:24:12 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: jstultz@...gle.com,
	tglx@...utronix.de,
	sboyd@...nel.org,
	linux-kernel@...r.kernel.org
Cc: Thorsten Blum <thorsten.blum@...lux.com>
Subject: [PATCH] timekeeping: Use min() to fix Coccinelle warning

Fixes the following Coccinelle/coccicheck warning reported by
minmax.cocci:

	WARNING opportunity for min()

Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
---
 kernel/time/timekeeping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 4e18db1819f8..f1a9c52b7c66 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -799,7 +799,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
 
 	while (delta > 0) {
 		u64 max = tk->tkr_mono.clock->max_cycles;
-		u64 incr = delta < max ? delta : max;
+		u64 incr = min(delta, max);
 
 		tk->tkr_mono.xtime_nsec += incr * tk->tkr_mono.mult;
 		tk->tkr_raw.xtime_nsec += incr * tk->tkr_raw.mult;
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ