Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6507893rwi; Mon, 24 Oct 2022 02:18:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ivRl7gd1hpnmjwNMfiU+5jcEKxedFenTpzS/keA9Y8UxCOpQxN0397o4QBiWmHfASMgQm X-Received: by 2002:a17:903:230d:b0:183:7f57:b5fe with SMTP id d13-20020a170903230d00b001837f57b5femr33115483plh.27.1666603129986; Mon, 24 Oct 2022 02:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666603129; cv=none; d=google.com; s=arc-20160816; b=HmmaYtXX/BUDBk2wkRTml7MRaoGCn+mbcj+fwWPm1OXROjyrOXZi5wT6bUlC65/acF T6Ykt/+hm2y2dsNZ3ip3pvXvqbx58pVUgDMAPcmqObDDeWo86pUiQ1fORU642iI3Dcb2 f5NcbToxSO716HtNXN9wSJ9AjQa9+XKhcQHYsAuUOBRHhW02b/ZbzSVW4bijfZz43sa/ gv1PYe6IkratTG5mohW5VhYtjPEdss0G796hSdBch63I3E5K2egaKTBTMOKb2Pr7z5fH CwQTMXpWB3leaH35kA2/t+Fl66TV+YPmTjNmJWzxPeZQQMcF+TBZrRRGQvdeb/HfPYy1 l7hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rjKtHFoIKCUA4OVYwCxCbh62/toC3MgpjesSx2sGQ7Q=; b=GX6o/8XE24fHEPKXvsKp+Rqhu40GmdGxBYFMDwlmy0sDOUt0UXiadxBTh83YUiiDDd IXLXlJPZWwGVTBX3xKMPYaBeNjXGSRiy3/RdxsxyTXVrH1rgjT8l5vFoQe89b5OuN8RE +8wJM3TVZcEgyX7luhL5yGUj+Y/+1Kn4nmS4x8MwgSXAbojM25roiwAiotuQxjVZWDnI zyhfhm7tUfwo1NF3C4shC6OZN5x9GukzoMadxr6Ipo9ypfIuAs853zwIcP6YCW6BF/a9 F9hHjthhdi+d1B04P/p4gFfFYEmzObgUQoEGgpRGblWBmWNiuiLRg7UDVZSkS0zWDihW TYdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a170902ec8800b001837ff673d3si6085467plg.262.2022.10.24.02.18.38; Mon, 24 Oct 2022 02:18:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbiJXJMo (ORCPT + 99 others); Mon, 24 Oct 2022 05:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbiJXJMm (ORCPT ); Mon, 24 Oct 2022 05:12:42 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72EF8537FD for ; Mon, 24 Oct 2022 02:12:41 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Mwq3T44Syz15M19; Mon, 24 Oct 2022 17:07:49 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 24 Oct 2022 17:12:39 +0800 Received: from localhost.localdomain (10.175.112.125) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 24 Oct 2022 17:12:38 +0800 From: Tong Tiangen To: Mark Rutland , , , , CC: Tong Tiangen , , Guohanjun Subject: [PATCH -next] init/main: Use strtobool for param parsing in set_debug_rodata() Date: Mon, 24 Oct 2022 09:38:17 +0000 Message-ID: <20221024093817.3003291-1-tongtiangen@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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