Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp231970lqn; Thu, 11 Apr 2024 22:18:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXukQeo67zO+4eHChK/k8Wj8Rj26GfDThevCXFFa1A2uoyXXIOhkgaELHNwVZfZUnSivZ50gGNt3xQpNhJqqYJ7OdXfDGrZ+LrG7Culug== X-Google-Smtp-Source: AGHT+IEfarlCSt1+E+HjKCzNIuCVUuiWoa25kjrgb/WHCWPjuQkddMikMD64ZTN1ZVMgXleTFZyy X-Received: by 2002:a05:620a:84b:b0:78d:4916:de0b with SMTP id u11-20020a05620a084b00b0078d4916de0bmr1885267qku.50.1712899115903; Thu, 11 Apr 2024 22:18:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712899115; cv=pass; d=google.com; s=arc-20160816; b=LHbDpXtrneExTiwLhQfDVja3P2Fux72+zV6tmADu8QmyQHGMAPiQ8zg997RGhwnUKe ++RiHGqu95mHpS6jvVYLZqd6wNSZZsQzg93FREGY4MuKfxIoSHtA+S0MMN3W9EWD/2Dp zz2sTASB1oNZ5canAeeK0CM4rI+XFFj5aiCxlnw9yOIGdJ8h+kk/wdDN12VMLyvZCbt4 TS9KzpvdNM+CpxFXQltHfEiGyBcC74WZhm3KlypcPXau+Qyd2wWCnsxBT1nG89aVXBfW w7m5+071TvoXkVdTb/O3wJIhbrp9AbwLRJ6rdUivy+nMYJ8iN7xpdmoW3MoYGntftcHP usQw== ARC-Message-Signature: i=2; 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:dkim-signature; bh=yDWBcZYS46EJMr8XxTksJu4fL5z/k//Og3IdRSR8+GU=; fh=LcA7QbbK2c2lk6ll+IhElNewdY8ZLFZztb4g7jkaV94=; b=0M83AaDzBslln6L8qwmWhgA7KqRs3cbOGi3JupH6IIb+htVyMbIsgLlzZRXEA+ZLrH oiHuQub1slcdiMG+TiMOX1SqOKAq2hCgsriP8RxpixbUJ3tnNrjdBIDlT5RZnb2BfzU7 a/NOlXdSV8B5+PMrAtEf8JGp9tIKOxCvOxqw1ttRvLH/xEGSJkwZ4d4CPxoNiewNQ5h2 cGVFb9T5lCw/UQzUav1LwaX7fGnFKdEcsuThZHmSx69pcu29ALMao0r3YjWbGBOIurEr y3Ph8sfVl4lPlvSYd8v1a81qlX2DlUhisbomnm0AyiGzJAZXxXmhpxTy93gTZyN6MfX1 tvXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wwe+EtfK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p6-20020a05620a22a600b00789e8e8f04esi2989638qkh.454.2024.04.11.22.18.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 22:18:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wwe+EtfK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141968-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 9BE451C2265F for ; Fri, 12 Apr 2024 05:18:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2756E18E3F; Fri, 12 Apr 2024 05:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wwe+EtfK" 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 473B717731; Fri, 12 Apr 2024 05:18:28 +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=1712899108; cv=none; b=av1Oqp4DI9CqtuatkfaV1XOMNam6mk/OiIuCrANCOMsLMsIE1iWjkFx9Gy90rZ9xLeLftWwlUNvAq/BXq+h0HYpkiwTOQcGtF2FSrES5q5Jag04T0cQueK+RhcmCFTjMAlwX2i0jMHPurfZlbuDMY+Iiv/y8nLwy8e6HTZ1/ARU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712899108; c=relaxed/simple; bh=INmCQ1fpE400k9JPfwAu6ECyCbxAnmhVAOebNyCBIzw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=edL6oEXBZDpO6jGL2p5xW8DgE82iHGDQM1y98DZXsOtKrjsyAV+SjhWocUkUm+HQDeTUND77j+adljrpo/BtF209q1UIPTY/bJ0ab1QiFHC8NzG0OYGWCbjSjUqlg0IyCOgkRGBvHps6+s9hpdsLPjJrWMvpkT7sULSyCK8RNys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wwe+EtfK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B32BC2BBFC; Fri, 12 Apr 2024 05:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712899108; bh=INmCQ1fpE400k9JPfwAu6ECyCbxAnmhVAOebNyCBIzw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Wwe+EtfK2fuopyb9scsa5ijsx9IAenvkV1Y4fCPsafZeHf8NFOTiZ2rW7s5/gtgpB 38r9mK9dWztcuiMTUevejtFmil1CZJWkISsOxYCNRqo9+wHbxGcHmLPHXM03NvOCUV UBxKH2ccMDBWv9ewyY1dQT5MeP9qYgpQJ1S0TrKypiEiiIQtf/mAqD3GDTVcr5c0di aM5lPi07dfPDqtf+2QXr9QNgbCwwhQA4QIWNJacEjiFatOKyFUY/AUGBsQ1XxFXYoX 2Vtv4wlJvJ2yWG7TySsWtWIoHRQP/uX0iIHGR4Y6MmVHuLrtn1Qzq9tXdhQGjI5Auq jvfFPb4NFDVDg== Date: Fri, 12 Apr 2024 14:18:22 +0900 From: Masami Hiramatsu (Google) To: Yuntao Wang Cc: akpm@linux-foundation.org, arnd@arndb.de, changbin.du@huawei.com, christophe.leroy@csgroup.eu, geert@linux-m68k.org, jpoimboe@kernel.org, kjlx@templeofstupid.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, ndesaulniers@google.com, peterz@infradead.org, tglx@linutronix.de, tj@kernel.org Subject: Re: [PATCH v2] init/main.c: Remove redundant space from saved_command_line Message-Id: <20240412141822.bc7cb44065dab62bf9f2e5ff@kernel.org> In-Reply-To: <20240412032950.12687-1-ytcoode@gmail.com> References: <20240412080839.c903a0058bd6594d31bc1d3e@kernel.org> <20240412032950.12687-1-ytcoode@gmail.com> X-Mailer: Sylpheed 3.7.0 (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 Fri, 12 Apr 2024 11:29:50 +0800 Yuntao Wang wrote: > There is a space at the end of extra_init_args. In the current logic, > copying extra_init_args to saved_command_line will cause extra spaces > in saved_command_line here or there. Remove the trailing space from > extra_init_args to make the string in saved_command_line look more perfect. > > Signed-off-by: Yuntao Wang OK, this looks good to me. Acked-by: Masami Hiramatsu (Google) Let me pick this to bootconfig/for-next. Thank you, > --- > v1 -> v2: Fix the issue using the method suggested by Masami > > init/main.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/init/main.c b/init/main.c > index 881f6230ee59..0f03dd15e0e2 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -627,8 +627,10 @@ static void __init setup_command_line(char *command_line) > > if (extra_command_line) > xlen = strlen(extra_command_line); > - if (extra_init_args) > + if (extra_init_args) { > + extra_init_args = strim(extra_init_args); /* remove trailing space */ > ilen = strlen(extra_init_args) + 4; /* for " -- " */ > + } > > len = xlen + strlen(boot_command_line) + 1; > > -- > 2.44.0 > -- Masami Hiramatsu (Google)