summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-08-27 04:45:16 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-09-02 05:43:42 +0200
commit01b58b1763b36d5597c9fbd6951d7e0386eebfb0 (patch)
tree82a9ad9eb54bc95bb692edaf4eb6f908d9c0dd3e /mm
parentlib/string_choices: add str_true_false()/str_false_true() helper (diff)
downloadlinux-01b58b1763b36d5597c9fbd6951d7e0386eebfb0.tar.xz
linux-01b58b1763b36d5597c9fbd6951d7e0386eebfb0.zip
mm: make use of str_true_false helper
The helper str_true_false() was introduced to return "true/false" string literal. We can simplify this format by str_true_false. Link: https://lkml.kernel.org/r/20240827024517.914100-3-lihongbo22@huawei.com Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Cc: Andy Shevchenko <andy@kernel.org> Cc: Anna Schumaker <anna@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Kees Cook <kees@kernel.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Trond Myklebust <trondmy@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-tiers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index 4775b3a3dabe..af9f5b0d6f1b 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -921,8 +921,7 @@ bool numa_demotion_enabled = false;
static ssize_t demotion_enabled_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
- return sysfs_emit(buf, "%s\n",
- numa_demotion_enabled ? "true" : "false");
+ return sysfs_emit(buf, "%s\n", str_true_false(numa_demotion_enabled));
}
static ssize_t demotion_enabled_store(struct kobject *kobj,