Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1757813lqe; Mon, 8 Apr 2024 21:44:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXyeXlj8wI5sTtI6IulyC5h934FBWZ3D6PjCw5X82a1VPhUsvuDDKbv+6qduWGzQ4k+OSxNqN4te0KmwrsLKOKmX0va7hpEwK60/2+Rew== X-Google-Smtp-Source: AGHT+IFwJXoTWVWjHvwyJ7WGD6XowtI1/RQ6ABVBM12kcFB/3oXQkmFqClC/ZtbDR1JrRKHj1r4L X-Received: by 2002:a05:622a:178c:b0:432:cfaf:85af with SMTP id s12-20020a05622a178c00b00432cfaf85afmr10829472qtk.0.1712637855737; Mon, 08 Apr 2024 21:44:15 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u4-20020ac858c4000000b00431710760ffsi9935367qta.132.2024.04.08.21.44.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 21:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=aRu3Bevp; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-136236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136236-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A3E81C24077 for ; Tue, 9 Apr 2024 04:44:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B46465F569; Tue, 9 Apr 2024 04:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aRu3Bevp" 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 CD0192B2DD; Tue, 9 Apr 2024 04:44:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712637840; cv=none; b=KYvFTUuymI75vFs/E1etxtqmHHJ6ogrcFjW2uq2PxAd4XPWpgfVrwWUHRsCYwawovJm3P8VxIuawMFMU1zLZazcBGHdUFFtlx96bTLO2xXCWqy3Txjh2ycdwi+ZUmBjaQs9My/Rwc/6B3836dK9G6n0fYaEVs08c4a+oy3oGKds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712637840; c=relaxed/simple; bh=leBEXkCaK3+c0BDJTMQ4LEGGdKWqrrDOjns+gsQwv74=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ix5rZMK26rqUCOGlgN8oKOvj98iliJbKnFXC4a9gknzcuVQa+WL+o30WPWXxnm3vihm6c1x7HiLeQAKqXLj3/7XxGUI6wUVjH3txnxupZPIL4I8U8qhms4jrzi57m3K6CPatSjIS07mAWAw8T7H+eS+fvdN2xpvr9FHnTwrb3Hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aRu3Bevp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D4DFC433F1; Tue, 9 Apr 2024 04:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712637840; bh=leBEXkCaK3+c0BDJTMQ4LEGGdKWqrrDOjns+gsQwv74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aRu3BevpJC52+U4MlDu1y6ru0D6MgY5T0BAc87twzgNRRZ6A9UFLNMDomkHATVMl7 0AYqHHBBTamsVtcgw7ekAJ/kiKEqEDB7q8P2uPUcIi6fLOfP43h3KqMs13Dz80nGE+ cEjrVT8fDHZHD6pswn6Tyr/uqq4Qr2d5vVuSvR3kx7KzIRmFpCkyQwJsVECHj6Fj2I Qp+lxSsNUuqZA4roJp/+pOvLKdQSHagc8cp8AWjxNQs030n8tNJGdHt9KqhIV3d3pO G9zbnnCOisFCMaOeSQbem33/YMHqYh05/92Nf/TMquH3Y5T7mZBUSodoNcC+gulfd5 Q8lxe+o6QGM4w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2A875CE12F2; Mon, 8 Apr 2024 21:44:00 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Zhenhua Huang , Masami Hiramatsu , "Paul E . McKenney" Subject: [PATCH v2 fs/proc/bootconfig 1/2] fs/proc: remove redundant comments from /proc/bootconfig Date: Mon, 8 Apr 2024 21:43:57 -0700 Message-Id: <20240409044358.1156477-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Zhenhua Huang 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 Signed-off-by: Paul E. McKenney Cc: Cc: Acked-by: Masami Hiramatsu (Google) --- 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 902b326e1e560..e5635a6b127b0 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.40.1