Skip to content

Commit 0ca863b

Browse files
visitorckwakpm00
authored andcommitted
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/[email protected] Signed-off-by: Kuan-Wei Chiu <[email protected]> Cc: Ching-Chun (Jim) Huang <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7da017e commit 0ca863b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/alloc_tag.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/proc_fs.h>
1010
#include <linux/seq_buf.h>
1111
#include <linux/seq_file.h>
12+
#include <linux/string_choices.h>
1213
#include <linux/vmalloc.h>
1314
#include <linux/kmemleak.h>
1415

@@ -726,7 +727,7 @@ static int __init setup_early_mem_profiling(char *str)
726727
}
727728
mem_profiling_support = true;
728729
pr_info("Memory allocation profiling is enabled %s compression and is turned %s!\n",
729-
compressed ? "with" : "without", enable ? "on" : "off");
730+
compressed ? "with" : "without", str_on_off(enable));
730731
}
731732

732733
if (enable != mem_alloc_profiling_enabled()) {

0 commit comments

Comments
 (0)