* [PATCH] s390/cmm: Use max to simplify cmm_timer_fn
@ 2025-12-22 10:39 Thorsten Blum
2025-12-22 10:57 ` Heiko Carstens
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-12-22 10:39 UTC (permalink / raw)
To: Alexander Gordeev, Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle
Cc: Thorsten Blum, linux-s390, linux-kernel
Use max() to replace the open-coded version and simplify cmm_timer_fn().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.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@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] s390/cmm: Use max to simplify cmm_timer_fn
2025-12-22 10:39 [PATCH] s390/cmm: Use max to simplify cmm_timer_fn Thorsten Blum
@ 2025-12-22 10:57 ` Heiko Carstens
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2025-12-22 10:57 UTC (permalink / raw)
To: Thorsten Blum
Cc: Alexander Gordeev, Gerald Schaefer, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, linux-s390, linux-kernel
Thorsten,
On Mon, Dec 22, 2025 at 11:39:17AM +0100, Thorsten Blum wrote:
> Use max() to replace the open-coded version and simplify cmm_timer_fn().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/s390/mm/cmm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
...
> 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);
Just in case it wasn't clear in the past: trivial patches like this won't be
taken. You already managed to send buggy patches which look trivial, and I'm
not willing to spend time to look for subtle bugs such trivial patches might
introduce.
In other words: you may stop sending such patches which address s390 code.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-22 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 10:39 [PATCH] s390/cmm: Use max to simplify cmm_timer_fn Thorsten Blum
2025-12-22 10:57 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox