* [PATCH] mm/damon/core: Use str_high_low() helper in damos_wmark_wait_us()
@ 2025-01-16 20:42 Thorsten Blum
2025-01-16 21:17 ` SeongJae Park
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-01-16 20:42 UTC (permalink / raw)
To: SeongJae Park, Andrew Morton; +Cc: Thorsten Blum, damon, linux-mm, linux-kernel
Remove hard-coded strings by using the str_high_low() helper function.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
mm/damon/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 0776452a1abb..ae1715a338d4 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -14,6 +14,7 @@
#include <linux/psi.h>
#include <linux/slab.h>
#include <linux/string.h>
+#include <linux/string_choices.h>
#define CREATE_TRACE_POINTS
#include <trace/events/damon.h>
@@ -1894,9 +1895,8 @@ static unsigned long damos_wmark_wait_us(struct damos *scheme)
if (metric > scheme->wmarks.high || scheme->wmarks.low > metric) {
if (scheme->wmarks.activated)
pr_debug("deactivate a scheme (%d) for %s wmark\n",
- scheme->action,
- metric > scheme->wmarks.high ?
- "high" : "low");
+ scheme->action,
+ str_high_low(metric > scheme->wmarks.high));
scheme->wmarks.activated = false;
return scheme->wmarks.interval;
}
--
2.48.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/damon/core: Use str_high_low() helper in damos_wmark_wait_us()
2025-01-16 20:42 [PATCH] mm/damon/core: Use str_high_low() helper in damos_wmark_wait_us() Thorsten Blum
@ 2025-01-16 21:17 ` SeongJae Park
0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2025-01-16 21:17 UTC (permalink / raw)
To: Thorsten Blum; +Cc: SeongJae Park, Andrew Morton, damon, linux-mm, linux-kernel
Hello Thorsten,
On Thu, 16 Jan 2025 21:42:16 +0100 Thorsten Blum <thorsten.blum@linux.dev> wrote:
> Remove hard-coded strings by using the str_high_low() helper function.
Thank you for this patch!
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
> ---
> mm/damon/core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 0776452a1abb..ae1715a338d4 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -14,6 +14,7 @@
> #include <linux/psi.h>
> #include <linux/slab.h>
> #include <linux/string.h>
> +#include <linux/string_choices.h>
>
> #define CREATE_TRACE_POINTS
> #include <trace/events/damon.h>
> @@ -1894,9 +1895,8 @@ static unsigned long damos_wmark_wait_us(struct damos *scheme)
> if (metric > scheme->wmarks.high || scheme->wmarks.low > metric) {
> if (scheme->wmarks.activated)
> pr_debug("deactivate a scheme (%d) for %s wmark\n",
> - scheme->action,
> - metric > scheme->wmarks.high ?
> - "high" : "low");
> + scheme->action,
> + str_high_low(metric > scheme->wmarks.high));
> scheme->wmarks.activated = false;
> return scheme->wmarks.interval;
> }
> --
> 2.48.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-16 21:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 20:42 [PATCH] mm/damon/core: Use str_high_low() helper in damos_wmark_wait_us() Thorsten Blum
2025-01-16 21:17 ` SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox