From patchwork Tue Aug 27 02:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Li X-Patchwork-Id: 13778734 Return-Path: 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 A268BC5321D for ; Tue, 27 Aug 2024 02:37:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B4036B0082; Mon, 26 Aug 2024 22:37:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 063C86B0083; 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 E1D756B0088; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BA9306B0082 for ; Mon, 26 Aug 2024 22:37:29 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 329E4815ED for ; Tue, 27 Aug 2024 02:37:29 +0000 (UTC) X-FDA: 82496464218.14.CBAB3E3 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf09.hostedemail.com (Postfix) with ESMTP id BACBC140017 for ; Tue, 27 Aug 2024 02:37:25 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724726132; 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: references; bh=2q6LCUS8Mc+VmSHEjPdZbYh8mk8T0xoGDBJzRMp7XF8=; b=ups8PdW9Xiexsu7UzgrX5u5KYLl+I0GwTnrSrMaW4fRnzP9NKTq8bOt26qrji0PHgwJwfB cB5dyVzctSzF2MimC09Qtrw/oCrhp+H2OwmWjIBZA0vJPxq/c6o8dOOKhxxdxhkeSKrACH 1XE+4w/Jc4yqRdSX9kbD9K95MkkhNc0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724726132; a=rsa-sha256; cv=none; b=BKdFCEO0wi2TenlE2mvi4sziw/145krQr0aEjQaPhg/fqFMS10LFN+EAW+HgHD7LdKcrVj vIF+OtM46yAwGETWj2xgGW/ggFkuLncM7tS1y5hO1Hlg6pmV0JeXjGsDkiK6mfonQRTXlJ 8on2VzHIYkfRc3UE57guP6aRG7xhTP8= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WtBTy4GRQzfZ5m; Tue, 27 Aug 2024 10:35:18 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id D518218007C; Tue, 27 Aug 2024 10:37:21 +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:21 +0800 From: Hongbo Li To: , , , , , CC: , , , Subject: [PATCH -next v3 0/3] Add str_true_false()/str_false_true() helper Date: Tue, 27 Aug 2024 10:45:14 +0800 Message-ID: <20240827024517.914100-1-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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-Server: rspam06 X-Rspamd-Queue-Id: BACBC140017 X-Stat-Signature: wj5ajbipy8ujs6f7wb6q66t66j6mgd3e X-Rspam-User: X-HE-Tag: 1724726245-903729 X-HE-Meta: U2FsdGVkX1+rituwkWOaOwYgVhIF29kSwJ0fuSAuF4AdsaQDXjxfWebNos3eSSVktnHfwiavbWk7QqTXAPP9U0q1YlHdHPS13GLGpFptPlhMuFiAhs57zJv/eMShIC2lAgQ3z/pocQ84G2JudIz6+cCS2phw4NCcFmAcva2aQO1gzgTLsVSAdisyRPrp+wr1fZm7VUQ6FyfVZQfN2utPdUyo1rED7GVhXprrMTOK0nCy8DGTzyc61AwrxG0tUJZVuZPygPOkNGPI1SWuJnVDntzuwn/4EZUgUGxRuycC17HHTSM1roKva4+0gVtAblfZ6g9QVA5ZGiEf8llnQ/tsH25HfeMzN1gtQawfRaWuBKCoIlXibgJy9kvBLk014q7tp3gOHB3PbKv8eutAcY7LosKoX5A4soyWxYcEQIFIJz68+c7NFquRXAT7eZ8csyYvMU43JIqmn2buCN0KkUxSjyl2Nq7x7w7p9VA7xhAiBPogeTCqKnXQZlXesI6SIabCqkvSMZIKs8GblmKJSyZ2zuR1qlZiMX3CKkJnX6JmrDrDbtjVvem4JPmz6Ll4gb37CQg3PrMdcXMZ61od/oBfbDr3PsDCwdwbBRg3SrUvpsrskDZ22vyDNz+WOmp2NaKYlkNmYZmVWQ+/Q/Qd8SJqUdvcN823YOfxEdj2QRNToneFH4rTAtUeJHQfSRNlWRyqtOHhys5fTdDqw8cZrgz5MW9qu1lDkt0BTlwQ6XuYLE1YZyLIB3dEiCqaRZcybdWNBMh2+oalRylc0WcW2MsjdcZVdlIzuoMcTInN6h+dpMuO+14UO/4M3HTZ4b+vDW25Ws1gvEw1ycj0MhVEbpTkAyLf72Wx0Jo8wCXqnA+HhjnqWFv6yQCmcGBilYfw/YfW4D7FP1ZZtppIfPi+Nw+DaSCQU4d/QSHSvsbDuNdq1C8jQuHULbsMTHc3odMuAZ05tCsFp0+Tq0AlQ0sUQ5u kwJaf1av NB/MC/Jw2MxzNfWAKBZOl30Ibq6I1IV2iwXxoLc3J0I/6hJqC+oO9BKjHhI976kGKP15npTII/UcTZ9hgAkGkjQEUBDafzXBNbyY+9+kqX6kpWKwaINmWHfffDmJzts+ZmSg/pi2OTPOi3ZmPLwb7oKMZ54qF+EHm+XO2b5EcghRk7a4vYMymAC5/9Srkx22DZJJVMi1GncktHtLM1Cz7hcRiOAadEty4YDacGO2AfqP4H9oy/RQlR+UMURrH87Cq57nm 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: List-Subscribe: List-Unsubscribe: Add str_true_false()/str_false_true() helper to "true" or "false" string literal. And we found more than 10 cases currently exist in the tree. So these helpers can be used for these cases. Patch 1: Introduce the str_true_false()/str_false_true() helper Patch 2: Use case for str_true_false. Patch 3: Use case for str_false_true. v3: - Add use cases for these new helpers. v2: https://lore.kernel.org/all/2024082407-shortlist-ultimate-2102@gregkh/T/#m0222c320c5395252b3f26f57d99b05509a58b74e - Squash into a single patch as Andy Shevchenko' suggesstion. v1: https://lore.kernel.org/all/1deb2bc4-0cd1-41a0-9434-65c02eef77ed@huawei.com/T/ Hongbo Li (3): lib/string_choices: Add str_true_false()/str_false_true() helper mm: make use of str_true_false helper nfs make use of str_false_true helper fs/nfs/nfs4xdr.c | 11 +++++------ include/linux/string_choices.h | 6 ++++++ mm/memory-tiers.c | 3 +-- 3 files changed, 12 insertions(+), 8 deletions(-)