[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251222103917.635026-2-thorsten.blum@linux.dev>
Date: Mon, 22 Dec 2025 11:39:17 +0100
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Alexander Gordeev <agordeev@...ux.ibm.com>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>,
linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] s390/cmm: Use max to simplify cmm_timer_fn
Use max() to replace the open-coded version and simplify cmm_timer_fn().
Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
---
arch/s390/mm/cmm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 06512bc178a5..fa1318d748b1 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -10,6 +10,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/gfp.h>
@@ -212,10 +213,7 @@ static void cmm_timer_fn(struct timer_list *unused)
long nr;
nr = cmm_timed_pages_target - cmm_timeout_pages;
- if (nr < 0)
- cmm_timed_pages_target = 0;
- else
- cmm_timed_pages_target = nr;
+ cmm_timed_pages_target = max(0, nr);
cmm_kick_thread();
cmm_set_timer();
}
--
Thorsten Blum <thorsten.blum@...ux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Powered by blists - more mailing lists