mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tong Tiangen <tongtiangen@huawei.com>
To: Mark Rutland <mark.rutland@arm.com>,
	<linux-kernel@vger.kernel.org>, <will@kernel.org>,
	<ardb@kernel.org>, <linux-arm-kernel@lists.infradead.org>
Cc: Tong Tiangen <tongtiangen@huawei.com>,
	<wangkefeng.wang@huawei.com>, Guohanjun <guohanjun@huawei.com>
Subject: [PATCH -next] init/main: Use strtobool for param parsing in set_debug_rodata()
Date: Mon, 24 Oct 2022 09:38:17 +0000	[thread overview]
Message-ID: <20221024093817.3003291-1-tongtiangen@huawei.com> (raw)

Aftern parsing "full", we can still use strtobool rather than "on" and
"off" parsing in set_debug_rodata().

Fixes: 2e8cff0a0eee ("arm64: fix rodata=full")
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
---
 init/main.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/init/main.c b/init/main.c
index aa21add5f7c5..f420e20b1fa3 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1463,13 +1463,7 @@ static int __init set_debug_rodata(char *str)
 	if (arch_parse_debug_rodata(str))
 		return 0;
 
-	if (str && !strcmp(str, "on"))
-		rodata_enabled = true;
-	else if (str && !strcmp(str, "off"))
-		rodata_enabled = false;
-	else
-		pr_warn("Invalid option string for rodata: '%s'\n", str);
-	return 0;
+	return strtobool(str, &rodata_enabled);
 }
 early_param("rodata", set_debug_rodata);
 #endif
-- 
2.25.1


             reply	other threads:[~2022-10-24  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  9:38 Tong Tiangen [this message]
2022-10-24 11:00 ` Mark Rutland
2022-10-24 11:27   ` Tong Tiangen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221024093817.3003291-1-tongtiangen@huawei.com \
    --to=tongtiangen@huawei.com \
    --cc=ardb@kernel.org \
    --cc=guohanjun@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®