linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: Use str_off_on() helper in build_all_zonelists()
@ 2024-10-21  9:13 Thorsten Blum
  2024-10-22  5:07 ` Anshuman Khandual
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-10-21  9:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Thorsten Blum, linux-mm, linux-kernel

Remove hard-coded strings by using the str_off_on() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8afab64814dc..11d3fa3587db 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5495,7 +5495,7 @@ void __ref build_all_zonelists(pg_data_t *pgdat)
 
 	pr_info("Built %u zonelists, mobility grouping %s.  Total pages: %ld\n",
 		nr_online_nodes,
-		page_group_by_mobility_disabled ? "off" : "on",
+		str_off_on(page_group_by_mobility_disabled),
 		vm_total_pages);
 #ifdef CONFIG_NUMA
 	pr_info("Policy zone: %s\n", zone_names[policy_zone]);
-- 
2.47.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/page_alloc: Use str_off_on() helper in build_all_zonelists()
  2024-10-21  9:13 [PATCH] mm/page_alloc: Use str_off_on() helper in build_all_zonelists() Thorsten Blum
@ 2024-10-22  5:07 ` Anshuman Khandual
  0 siblings, 0 replies; 2+ messages in thread
From: Anshuman Khandual @ 2024-10-22  5:07 UTC (permalink / raw)
  To: Thorsten Blum, Andrew Morton; +Cc: linux-mm, linux-kernel



On 10/21/24 14:43, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_off_on() helper function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 8afab64814dc..11d3fa3587db 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5495,7 +5495,7 @@ void __ref build_all_zonelists(pg_data_t *pgdat)
>  
>  	pr_info("Built %u zonelists, mobility grouping %s.  Total pages: %ld\n",
>  		nr_online_nodes,
> -		page_group_by_mobility_disabled ? "off" : "on",
> +		str_off_on(page_group_by_mobility_disabled),
>  		vm_total_pages);
>  #ifdef CONFIG_NUMA
>  	pr_info("Policy zone: %s\n", zone_names[policy_zone]);

There are multiple other instances which could use similar str_on_off() as well.

mm/kasan/hw_tags.c:             kasan_vmalloc_enabled() ? "on" : "off",
mm/kasan/hw_tags.c:             kasan_stack_collection_enabled() ? "on" : "off");
mm/kasan/sw_tags.c:             kasan_stack_collection_enabled() ? "on" : "off");
mm/mm_init.c:           stack, want_init_on_alloc(GFP_KERNEL) ? "on" : "off",
mm/mm_init.c:           want_init_on_free() ? "on" : "off");

I would suggest converting all of them together in a single patch instead.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-22  5:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21  9:13 [PATCH] mm/page_alloc: Use str_off_on() helper in build_all_zonelists() Thorsten Blum
2024-10-22  5:07 ` Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox