Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7376277rdb; Wed, 3 Jan 2024 13:59:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwecc3uTwqhCf0+8RvFl2Ka4xcud6QTXCaBq0LR4VHysoRcsA6nkWiTCFXarstgbnFzWlG X-Received: by 2002:a05:6a00:4587:b0:6d9:8d46:814b with SMTP id it7-20020a056a00458700b006d98d46814bmr21191770pfb.20.1704319157616; Wed, 03 Jan 2024 13:59:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704319157; cv=none; d=google.com; s=arc-20160816; b=dvJHi48nqbVn45fzq5drMk6rDjvTxRVzdQxTFe+d55/NtCEqYwtLQ/BtM3pYZuPpAH HYZ4xHiQ72nKtdH8VSE0lpk7dCdB8mwJmrwjUfOBXjvbnuC7A5k+IKQVK8rBl2F5cqWr 5nqbXiWu3XseHH3hV8Kmxw8k6Q3qDuUOxyaIWqK84gY0t0egtdtFxajsKze422MMVcrz WBGW9Rewv6d4eMymO3WdtNP/1qHAs9rVOV1ZkeUd7/v0eInpK7i9QfY7zROej1JeeeSy aLu7FDTpdSQLC7nxkCehK8qaFm/QuSLNARuxS3F0tWDogXKZ5xmXmhkneUOISw/bzlj+ eOzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5usLRCLbH50zC/xnBzlTpXS2rfJYesRRMs/70jVnFTg=; fh=9UtTiHJ2RAXmvUgF+NCqJ6i/JBfxqAzfWWsB9kby5D0=; b=JMDOy8jecwdZ7kUWL3NLx/JLE5r5F4+07xmpFhAjR+H6JXnvBu9E1BG6qc8kmT3ewu NDj0FGimBDmyeyNBJnWrdteHSKbnG1dK2CNl09KZttB1tvE6Nj/uvm7F/Y62Hp+ugO3d ZTfok1vL9R1erlzQXiPDYGgpIpCjxLOd72sp3d2Nc+7cOAICmNY1KP5d4tbd1rPb0HDN 7U/YkExdJuRryf5l5sivJHSak+Pe7w9VjBD54PYc6rXdOGkziWdLqFlKOuHZA7EyvDrh tIXQTJGHzg/4bzeQrZbPaLsj+L9/lfSmHuIsCPMBAXGTjyEBQLpoQSkANPMdxNr6XhIc 7m1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dD7VXYE2; spf=pass (google.com: domain of linux-kernel+bounces-16042-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h7-20020a655187000000b005c677a35324si22567909pgq.464.2024.01.03.13.59.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 13:59:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16042-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dD7VXYE2; spf=pass (google.com: domain of linux-kernel+bounces-16042-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A3660B236D7 for ; Wed, 3 Jan 2024 21:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C16951DA3D; Wed, 3 Jan 2024 21:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dD7VXYE2" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0CE01DA28; Wed, 3 Jan 2024 21:58:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8238C433C7; Wed, 3 Jan 2024 21:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704319137; bh=Lfw/gZHq3F/5AfUkw9ZLkKesfdYnFOXFvfp2chRDLQs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=dD7VXYE2l4DD3k/oNHtL5+9DJm0SWk3axjpxGdp0iZlzgfrB5OJVsE/BS/Irb5KNI IG4tY/X5LCF2FnqSh347rROtopQ2Z+/VfF36gsTE3AE4H/wg+ZfPlQA2J8CtqLbcjb 3jWTXFlFINDOAyo/yqd0CZErPhVyMn2syY4aNKUcNGhu7zDfyW+RfixDuMImqv4c1u D9t5tMGSIjJUaXsIiIe2/9LTCDV89ofdsr3QKH+H/1RGZNrdQwYkDyJdtdHsM59sbz 5WL3AexKbilAcLxC4Tp2ZSUHqx02VVLScXnBVe8HUidScbsAK8J/jMKzbRqGTjwoXC uEriQMHrESuGw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5F36FCE08F4; Wed, 3 Jan 2024 13:58:57 -0800 (PST) Date: Wed, 3 Jan 2024 13:58:57 -0800 From: "Paul E. McKenney" To: Zhenhua Huang Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, quic_tingweiz@quicinc.com Subject: Re: [PATCH 1/1] fs/proc: remove redudant comments from /proc/bootconfig Message-ID: Reply-To: paulmck@kernel.org References: <1704190777-26430-1-git-send-email-quic_zhenhuah@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1704190777-26430-1-git-send-email-quic_zhenhuah@quicinc.com> On Tue, Jan 02, 2024 at 06:19:37PM +0800, Zhenhua Huang wrote: > commit 717c7c894d4b ("fs/proc: Add boot loader arguments as comment to > /proc/bootconfig") adds bootloader argument comments into /proc/bootconfig. > > /proc/bootconfig shows boot_command_line[] multiple times following > every xbc key value pair, that's duplicated and not necessary. > Remove redundant ones. > > Output before and after the fix is like: > key1 = value1 > *bootloader argument comments* > key2 = value2 > *bootloader argument comments* > key3 = value3 > *bootloader argument comments* > ... > > key1 = value1 > key2 = value2 > key3 = value3 > *bootloader argument comments* > ... > > Fixes: 717c7c894d4b ("fs/proc: Add boot loader arguments as comment to /proc/bootconfig") > Signed-off-by: Zhenhua Huang Good catch, and what I get for testing with only a single bootconfig parameter. :-/ Reviewed-by: Paul E. McKenney Tested-by: Paul E. McKenney > --- > fs/proc/bootconfig.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/proc/bootconfig.c b/fs/proc/bootconfig.c > index 902b326..e5635a6 100644 > --- a/fs/proc/bootconfig.c > +++ b/fs/proc/bootconfig.c > @@ -62,12 +62,12 @@ static int __init copy_xbc_key_value_list(char *dst, size_t size) > break; > dst += ret; > } > - if (ret >= 0 && boot_command_line[0]) { > - ret = snprintf(dst, rest(dst, end), "# Parameters from bootloader:\n# %s\n", > - boot_command_line); > - if (ret > 0) > - dst += ret; > - } > + } > + if (ret >= 0 && boot_command_line[0]) { > + ret = snprintf(dst, rest(dst, end), "# Parameters from bootloader:\n# %s\n", > + boot_command_line); > + if (ret > 0) > + dst += ret; > } > out: > kfree(key); > -- > 2.7.4 >