Message ID | 20240827024517.914100-3-lihongbo22@huawei.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 01b58b1763b36d5597c9fbd6951d7e0386eebfb0 |
Headers | show |
Series | Add str_true_false()/str_false_true() helper | expand |
diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index 2a642ea86cb2..66ea9099dd63 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -940,8 +940,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,
The helper str_true_false is introduced to reback "true/false" string literal. We can simplify this format by str_true_false. Signed-off-by: Hongbo Li <lihongbo22@huawei.com> --- mm/memory-tiers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)