Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36919799rwd; Tue, 11 Jul 2023 07:19:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1xUP79X+ZZ3faEys+hMuM/7iuHmGqwtCD6EvLyNvUc7LJC6rwRYZOqmaZpz76Pz/X1lXP X-Received: by 2002:a17:906:5a51:b0:989:1a52:72b5 with SMTP id my17-20020a1709065a5100b009891a5272b5mr18014438ejc.45.1689085145215; Tue, 11 Jul 2023 07:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689085145; cv=none; d=google.com; s=arc-20160816; b=oSrHqvImopFxu7Pq22I7lwbcwYAbfawGFCXK3Fv9IVhT82M85YTMpsZS+zOOD/1E0V WaZqQPys5+DKA4oyb036tJOhEuWKaXSrPuy8pyEnOCSV/yT4wzM475a48tL+3uu7gT5d Aip/kj7vkit38aV4BQV9AeZebyz/Hb18b/A8A6gGqk7w+higcnocctrxsT5iYhu24orz 4Dcl/+M/rfhSCOG52/OuneMHipBtVOTstlKRE3osWN4cE5Poca8Cc2zAM8B8stnT/ISc 56+HuzQUHsvjqXD+tdZ1xSi9Qu4aOmkEGGBKhSQtf/4WSh6WNXti1XamfS3szoVaIvJW mH1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=MPV+xRfSsfvw1i+nS5khi3c/vkLcVjGuPDQc137LFwc=; fh=z849AaasVP88nFnyoMJyqjWDLFbI2HQ4AuBSEJaCN/E=; b=MUHaNst+BeDT8a8Ab73vhUYmALq2e56EMFFxJ3cwF+LXuuma7g9mXnvPhK4B5CCSAf 6dUhk5dtu/eM6eCnLP5C4LykTaLBCHacKd0Q3ubVJI37pCDD6npYrMbDjG8SC1vnbRi6 HQu0AcdbRUjn5V4IF6/ReDzz/1tZsn7u7BTHA4RGfvcJsnmw+lVRuyPZ6CQg/BW1tLWw qP3KKKn5+aiceNHC8Ata657jfKWxFB6x+rz2l2aMcLmjZtnPGIeRb3Pzhu0NfpMpdK1V w4yM4bUdqTsoOKobo77LGJXiuJ8mk21Q5nOMQGtpH9gubTxvKoXGRusQbb5R7CSXHd8I TRuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=HoA7CsT1; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a1709063b4200b0098e1ade896asi1944718ejf.283.2023.07.11.07.18.40; Tue, 11 Jul 2023 07:19:05 -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; dkim=pass header.i=@xry111.site header.s=default header.b=HoA7CsT1; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231690AbjGKNcg (ORCPT + 99 others); Tue, 11 Jul 2023 09:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbjGKNce (ORCPT ); Tue, 11 Jul 2023 09:32:34 -0400 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD5CE6C for ; Tue, 11 Jul 2023 06:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1689082352; bh=VC99mbHi4AmfAoiUCA8Y/mu2KyCyRbtpGMBesSFehV8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HoA7CsT1lVhUWuNRJBPiVYZjP/ouAsdDBcUtop5f1RKE5K4tafMAuur15O36Otun2 E9CFIKJb28YZ7uVgrv52WBxecSGMitHbwSjY6KezRmR2UQVaay196vVxLkbl+yB/24 awaWu4iDHTjrSONzXNhcXgHbwImPVmYpBZFvUf0Y= Received: from [192.168.124.11] (unknown [113.140.11.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 0C35566455; Tue, 11 Jul 2023 09:32:30 -0400 (EDT) Message-ID: Subject: Re: [PATCH v2] LOONGARCH: Make CONFIG_CMDLINE work with CONFIG_CMDLINE_EXTEND and CONFIG_CMDLINE_BOOTLOADER From: Xi Ruoyao To: Dong Zhihong , chenhuacai@kernel.org, kernel@xen0n.name Cc: ardb@kernel.org, tangyouling@loongson.cn, zhoubinbin@loongson.cn, yangtiezhu@loongson.cn, tglx@linutronix.de, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Date: Tue, 11 Jul 2023 21:32:29 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Use "LoongArch" instead of "LOONGARCH". "LOONGARCH" should only show up in macro names, enum value names, etc. On Tue, 2023-07-11 at 21:27 +0800, Dong Zhihong wrote: > This patch tends to make CONFIG_CMDLINE work with CONFIG_CMDLINE_EXTEND As Markus already told you, submitting-patches.rst says: "Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behaviour." i. e. "Make CONFIG_CMDLINE work with ...". > and CONFIG_CMDLINE_BOOTLOADER. The touched function is bootcmdline_init()= `. > There's already code handling CONFIG_CMDLINE_FORCE, which replaces > `boot_command_line` with CONFIG_CMDLINE and immediately`goto out`. It'd b= e > similar way to handle CONFIG_CMDLINE_EXTEND and CONFIG_CMDLINE_BOOTLOADER= , > so I added some code after OF_FLATTREE part to handle them. >=20 > Signed-off-by: Dong Zhihong > --- >=20 > v2 -> v1:Reworded the commit message so it's more imperative (Markus); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Added `goto out` to FDT p= art (Huacai) >=20 > =C2=A0arch/loongarch/kernel/setup.c | 17 +++++++++++++++++ > =C2=A01 file changed, 17 insertions(+) >=20 > diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.= c > index 78a00359bde3..3cafda1a409e 100644 > --- a/arch/loongarch/kernel/setup.c > +++ b/arch/loongarch/kernel/setup.c > @@ -332,7 +332,24 @@ static void __init bootcmdline_init(char **cmdline_p= ) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0str= lcat(boot_command_line, " ", COMMAND_LINE_SIZE); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0strlcat(boot_command_line, init_command_line, COMMA= ND_LINE_SIZE); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0goto out; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > +#endif > + > +#ifdef CONFIG_CMDLINE > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * If CONFIG_CMDLINE_BOOTLOADE= R is enabled then we use thei built-in > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * command line if no command = line given, or we append given command > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * line to the built-in one if= CONFIG_CMDLINE_EXTEND is enabled. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (IS_ENABLED(CONFIG_CMDLINE_= EXTEND)) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_S= IZE); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0strlcat(boot_command_line, init_command_line, COMMAND_LIN= E_SIZE); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (IS_ENABLED(CONFIG_CMDLINE_= BOOTLOADER) && !boot_command_line[0]) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_S= IZE); > =C2=A0#endif > =C2=A0 > =C2=A0out: --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University