From: Kuan-Wei Chiu Date: Thu, 14 Aug 2025 09:38:27 +0000 (+0800) Subject: alloc_tag: use str_on_off() helper X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ca863b7c638803722dc5596b2d520812cf283b7;p=users%2Fhch%2Fmisc.git alloc_tag: use str_on_off() helper Replace the ternary (enable ? "on" : "off") with the str_on_off() helper from string_choices.h. This improves readability by replacing the three-operand ternary with a single function call, ensures consistent string output, and allows potential string deduplication by the linker, resulting in a slightly smaller binary. Link: https://lkml.kernel.org/r/20250814093827.237980-1-visitorckw@gmail.com Signed-off-by: Kuan-Wei Chiu Cc: Ching-Chun (Jim) Huang Cc: Kent Overstreet Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton --- diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index e9b33848700a..d4449205eca2 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -726,7 +727,7 @@ static int __init setup_early_mem_profiling(char *str) } mem_profiling_support = true; pr_info("Memory allocation profiling is enabled %s compression and is turned %s!\n", - compressed ? "with" : "without", enable ? "on" : "off"); + compressed ? "with" : "without", str_on_off(enable)); } if (enable != mem_alloc_profiling_enabled()) {