lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240827024517.914100-3-lihongbo22@huawei.com>
Date: Tue, 27 Aug 2024 10:45:16 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: <kees@...nel.org>, <andy@...nel.org>, <akpm@...ux-foundation.org>,
	<trondmy@...nel.org>, <anna@...nel.org>, <gregkh@...uxfoundation.org>
CC: <linux-hardening@...r.kernel.org>, <linux-mm@...ck.org>,
	<linux-nfs@...r.kernel.org>, <lihongbo22@...wei.com>
Subject: [PATCH -next v3 2/3] mm: make use of str_true_false helper

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@...wei.com>
---
 mm/memory-tiers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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,
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ