[PATCH] s390/cmm: Use max to simplify cmm_timer_fn
From: Thorsten Blum
Date: Mon Dec 22 2025 - 05:39:36 EST
Use max() to replace the open-coded version and simplify cmm_timer_fn().
Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
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@xxxxxxxxx>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4