Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6653801rwi; Mon, 24 Oct 2022 04:32:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43ciqWT5DYTji2OYU9XfcD0lJ9/WQuSE/TxWrseNa5MeMUHX54FGAGo/Sci7SBtJPl8gcA X-Received: by 2002:a17:90b:314c:b0:20d:83c1:5297 with SMTP id ip12-20020a17090b314c00b0020d83c15297mr37762230pjb.18.1666611173827; Mon, 24 Oct 2022 04:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666611173; cv=none; d=google.com; s=arc-20160816; b=F/cO0qZy5i0fsw7dHEzyIKelXx1bq/Z4PcVXbXX/XNLtdLpIQhfMDJunhXSLpeSGDG uUzmUEE8l41/jvZGv5rtmVV0oDdxILl82eowzIhDP+VE/EO4CFclNZjM2i8B7huG5T0H rlp0FScMCI9G/Gt8m7TuGyoEIPa+MrF9uosw7M4EMIeIAK5cMJ3RN2wSzRAky/Tdmb7H kz6rYnBgoMPLkKpTQHhpM5mNU48HCLi+hrdAWEjbJ6BCgijOtZ2e/Z0YaFoc5XHa2BGN G9QT9Y3i5B98HDIu2MA7iUaPiuL/mTCq0xQc3n3A4dBJWnBPSoseSzhREtfjPCZUGX9D V7Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=adTmupezPvWOGwsOfBxlngFp3PDrd13pBCTgg9NuS1Q=; b=xlIOi0RvFFCsF41oB959XU6HqPBPmJNlPZJQeXo6SqdlVThG7L40wixoVvO8I1sRL/ +UylcAvJY2lsUDntprEUbKbvW2qLnGz9BZVYOAs2ffDzeSRYmh08saKdAmhEc3RBbTuO Fhx2/CQpwq9TeTISXA0HlKlT8mU21cHiWTzh2GFWGS7vQSrEqozpgPiq1Odfu/88gHhV ANIOvX3dla9nqHBV0wXL8qOSjlNFsQc8Vh7BHRGU0LcdZfmwpw/4HUiZUo5Gk98WtMdm 9XRbzStMRTNZSh6q3WT9f6UZGIPCSp4WZiZpkuwlZLfxgvTa8TeczWENkRLtItwnjpwL bTtg== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q34-20020a635c22000000b0043c9db24662si34653832pgb.269.2022.10.24.04.32.42; Mon, 24 Oct 2022 04:32:53 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbiJXLDh (ORCPT + 99 others); Mon, 24 Oct 2022 07:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiJXLC6 (ORCPT ); Mon, 24 Oct 2022 07:02:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F35216C114 for ; Mon, 24 Oct 2022 04:01:09 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F65F2B; Mon, 24 Oct 2022 04:01:11 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.7.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A7F13F7B4; Mon, 24 Oct 2022 04:01:04 -0700 (PDT) Date: Mon, 24 Oct 2022 12:00:57 +0100 From: Mark Rutland To: Tong Tiangen Cc: linux-kernel@vger.kernel.org, will@kernel.org, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, wangkefeng.wang@huawei.com, Guohanjun Subject: Re: [PATCH -next] init/main: Use strtobool for param parsing in set_debug_rodata() Message-ID: References: <20221024093817.3003291-1-tongtiangen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221024093817.3003291-1-tongtiangen@huawei.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On Mon, Oct 24, 2022 at 09:38:17AM +0000, Tong Tiangen wrote: > Aftern parsing "full", we can still use strtobool rather than "on" and > "off" parsing in set_debug_rodata(). > > Fixes: 2e8cff0a0eee ("arm64: fix rodata=full") Why do you think this is a fix; what do you believe is broken? As noted in the commit message for 2e8cff0a0eee, we *deliberately* don't use strtobool() here so that we don't accept garbage values like "ful". NAK to this patch as it stands. Thanks, Mark. > 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 >