Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <visitorckw@gmail.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kuan-Wei Chiu and committed by
Andrew Morton
0ca863b7 7da017ea

+2 -1
+2 -1
lib/alloc_tag.c
··· 9 9 #include <linux/proc_fs.h> 10 10 #include <linux/seq_buf.h> 11 11 #include <linux/seq_file.h> 12 + #include <linux/string_choices.h> 12 13 #include <linux/vmalloc.h> 13 14 #include <linux/kmemleak.h> 14 15 ··· 727 726 } 728 727 mem_profiling_support = true; 729 728 pr_info("Memory allocation profiling is enabled %s compression and is turned %s!\n", 730 - compressed ? "with" : "without", enable ? "on" : "off"); 729 + compressed ? "with" : "without", str_on_off(enable)); 731 730 } 732 731 733 732 if (enable != mem_alloc_profiling_enabled()) {