Message ID | 20240827024517.914100-3-lihongbo22@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C3E5C5472D for <linux-mm@archiver.kernel.org>; Tue, 27 Aug 2024 02:37:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C25346B007B; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE0556B0085; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC3E76B0083; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8EDA76B007B for <linux-mm@kvack.org>; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3A35614152D for <linux-mm@kvack.org>; Tue, 27 Aug 2024 02:37:29 +0000 (UTC) X-FDA: 82496464218.09.9A1DF4D Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id DFDCE20015 for <linux-mm@kvack.org>; Tue, 27 Aug 2024 02:37:26 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724726183; a=rsa-sha256; cv=none; b=ybQfdpg53+xbd+6MCbgQmsy1/y0kyUSo1rYmNoFjP1auVjo6G5sbS6tLqF/wC+g4yDweLk GfG0SXTVPwd0sbIcIGxvePF1NphyvufRBta5YCjC0mT7gbXkxO8AyVpv1uaQT50CfaSRg1 PadXVIXhF1p6vALXR5YZLC3qkMj0nbs= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724726183; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=obNubUA2MZgKXlZ/nGu2n6WHltKqkX03fnlWZZgfk2Q=; b=4UwBQRhl1ecmlAQPSuADafvoBpZk22UK/0jw52ZLw85U8xfLRruj5Xnn1woAMt9Z0ldF5I XYGt9473wDsGNpPPT8pT25pReohjsN9jWT/8sk0lGa6CocIEuftTDetFJovcbczs9JHFek MgkePG0wDOwKpFBQb+epMtpldHSRB+M= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WtBWS6H3rzyQTf; Tue, 27 Aug 2024 10:36:36 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id 8EF5118007C; Tue, 27 Aug 2024 10:37:23 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 27 Aug 2024 10:37:23 +0800 From: Hongbo Li <lihongbo22@huawei.com> To: <kees@kernel.org>, <andy@kernel.org>, <akpm@linux-foundation.org>, <trondmy@kernel.org>, <anna@kernel.org>, <gregkh@linuxfoundation.org> CC: <linux-hardening@vger.kernel.org>, <linux-mm@kvack.org>, <linux-nfs@vger.kernel.org>, <lihongbo22@huawei.com> Subject: [PATCH -next v3 2/3] mm: make use of str_true_false helper Date: Tue, 27 Aug 2024 10:45:16 +0800 Message-ID: <20240827024517.914100-3-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827024517.914100-1-lihongbo22@huawei.com> References: <20240827024517.914100-1-lihongbo22@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500022.china.huawei.com (7.185.36.66) X-Rspamd-Queue-Id: DFDCE20015 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: na41ia6sse94qzg4qx3czqm17k36c1pu X-HE-Tag: 1724726246-620932 X-HE-Meta: U2FsdGVkX18qc4uz4VRV2LALZ4AUSan/YTyt7GXo7nOw6DPUHmED50e7itaAyMNwqxhDSApgRefzjK5c6pWz6ECKV1dgOTz3VKLTkXFS8x7yuR1VBPrU1qJznSHOY4OJ/AMQxsKTY6rGK2yej5AUN8vPAek0GPKNPYNeLdpim0MZsGK0Q9PaOj4m9F6WJPT8jJjHXqjVm+F01Q33jJg/OCYVQmmxsgTjUOqFF7mnlt7TgrJzY1ygvNdwXWj9+kBMS6lK7faqYow4hWMJFB/mcN8vYZzIlMlmtmFipVvHYzEc8fSJoz236To0lcgGov3CsT75RXRHXORE+aQjtYzMcG8uepUkzAaGNTnksLgRdRnkHVatAIapH0vd2gViWnCGt6R+w4bg5PhvcEqWSGx789H1n53asOiI3mmTz8Xox1tsWqNqwvI6IBotMwnUsbthyP4z1pgu+2T7h/28Bwe6jLMjEQZ+49kChUhv6Faz2mTq2ZE4wLczxMbrk8wb5SsPoD1DbeVfavwR6Ro5L+h9ociOiZj9yjwcWwsnr5/BB2C/gJqQJVMiJdHgWDZe0BnOI7MrHdODUNvF0jhKr4pzJ1RR3pbOK2Q9a/Y0bF5CK33CNNlnm7AfqIHlAnrvLzQrnNtlmGVVdVBBHry9DG/y2kS1oUpiWXcl3osLcXXqxg1/AeLN08QKKCTXI6FxdVlRCSrgW+eLLAeu3YuicZBYsqzhYuiLg1k/NktSt9HtE9cPaZ+Qz7Y1HxCLtMrfDVfAI7tS0s+BHaV9l3fGCzzgnSePDbp5tAyhDcfY/Tri2QTyFkWZTzqhKw1POyVHXojERBW2/WVLMHnhwafKqMXyELYdoTbMnB2JlltweeZii2qsj7oGQTZCp6465apT1+cuNcwT3hJH+n7cKyDEfmTTbjKiPb9tYeg4PyjtzEwapAZ1oVIZTPy2MdGmk3Ohieo628cNPt22AGNbOGfUGtw kmSsN37U HQKhnxmC2BjXRIx1WfXWfdaLrp8E124/kjMBs0HyekRN6rY2o+w0rmpd59OBxJNQrKmFVdidlQRglu5nxDx4A/KoWawOxuZsEpBnvfhjsuUEcnco325sN5vPVTDr8AEFqQ9WjdVnALMb8mTMb61fe0EgEbSNyQ6DHU8NB+SkShV0zs9puXSRD05rYJfwFOI/+jOIL X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
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(-)