Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6889264rdb; Tue, 2 Jan 2024 18:17:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH+wZIIw6Xn/ta45PW0ca0IFCi/z6L44Y4xqxuuXwdQXif1kt9KH0vvg6UV5iLI0H+en4z X-Received: by 2002:a17:906:73c1:b0:a23:8fd0:d6b5 with SMTP id n1-20020a17090673c100b00a238fd0d6b5mr4534684ejl.209.1704248266652; Tue, 02 Jan 2024 18:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704248266; cv=none; d=google.com; s=arc-20160816; b=Ss9mlzsypaAYFKzd2E9cGfIW6OJR7v3tLJE/24um+zGYXAXIhvDlWW1P1BDMq0yC4H 0Jui1QH2lZZe945C3R9tg++PNgJMQn33Fx7IlniPQT27oxPJ3RWRpJJg7V+4J1gfoPRb +cWabv6BiF5hjgaHqY2N09BujBFl5KbN5RQXPaXdmR8aBQSRmw8ahV486kTmFXnQr6LA Ut75/SQx858cfjzhJYcqaEUMJY4L/oXYBi6EzgzNz2FO3twaFMUsEpA4lOFvG8ULr8/d m8RMUnVXzGse0qbrMnDuRVEhSv8xn0eCoFCvrCpl709ZrcgzT6+95tLExPiwkyQPJGGw Gj5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=S/cPM+wjQ75TPKFhxv7JYWB1VR37gWAA2WKiqaNmVxk=; fh=QyIOIiVShw3lRuRVnssMa3x/LC2iQvoobj1sz7ZiiEI=; b=aVLySv+EcizXI5Qpc6vHEYEcIknw1JtDuBAPjmcvVuOLnyMImjTuSaXa6xDgz9pw0y Oh0P0TREQrauUPc668JbYZhoHdh4mLAAnb380XgJGyJAQDX//U2b5NzmqGdERpX3cQA3 wnlvPB5UOMPPI9ydMxCCCzMPFsn3n9B5WoSHWAILJfNkltSQ/Pj+V3uRsibF+lAWsHWR zdwpTDWgXLU0ajjcV7PBZuTlchG+pA2CY+DvFhvGoV9/r/6rfmKSi2nKAaKgfWSj+jPn weK3hQlC4xNmoHsb+cF7iHhn/lDlF93hqVGmVSqNuyWQKVuBPc02zMXKDVaED2hPn5mf gyhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15062-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id zw21-20020a17090771d500b00a26e257793esi8317067ejb.452.2024.01.02.18.17.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:17:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15062-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 681461F21C36 for ; Wed, 3 Jan 2024 02:17:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2282520EC; Wed, 3 Jan 2024 02:17:28 +0000 (UTC) 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 A1E93139E; Wed, 3 Jan 2024 02:17:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C53AC433C8; Wed, 3 Jan 2024 02:17:26 +0000 (UTC) Date: Tue, 2 Jan 2024 21:18:27 -0500 From: Steven Rostedt To: Zhenhua Huang Cc: , , , , , Subject: Re: [PATCH 1/1] fs/proc: remove redudant comments from /proc/bootconfig Message-ID: <20240102211827.0841c0df@gandalf.local.home> In-Reply-To: <1704190777-26430-1-git-send-email-quic_zhenhuah@quicinc.com> References: <1704190777-26430-1-git-send-email-quic_zhenhuah@quicinc.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 2 Jan 2024 18:19:37 +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 Nice catch. Reviewed-by: Steven Rostedt (Google) -- Steve > --- > 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);