From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Yuntao Wang <ytcoode@gmail.com>
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
Date: Fri, 12 Apr 2024 14:18:22 +0900 [thread overview]
Message-ID: <20240412141822.bc7cb44065dab62bf9f2e5ff@kernel.org> (raw)
In-Reply-To: <20240412032950.12687-1-ytcoode@gmail.com>
On Fri, 12 Apr 2024 11:29:50 +0800
Yuntao Wang <ytcoode@gmail.com> 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 <ytcoode@gmail.com>
OK, this looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
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) <mhiramat@kernel.org>
prev parent reply other threads:[~2024-04-12 5:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240411041200.225356-1-ytcoode@gmail.com>
[not found] ` <CAMuHMdU1-F0eZAXUyVCt2ik2w9J+vTm1DnvTVwx2hNz1CDZc1g@mail.gmail.com>
2024-04-11 14:07 ` [PATCH] init/main.c: Remove redundant space from saved_command_line Masami Hiramatsu
2024-04-11 15:29 ` Yuntao Wang
2024-04-11 23:08 ` Masami Hiramatsu
2024-04-12 1:46 ` Yuntao Wang
2024-04-12 3:29 ` [PATCH v2] " Yuntao Wang
2024-04-12 5:18 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240412141822.bc7cb44065dab62bf9f2e5ff@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=changbin.du@huawei.com \
--cc=christophe.leroy@csgroup.eu \
--cc=geert@linux-m68k.org \
--cc=jpoimboe@kernel.org \
--cc=kjlx@templeofstupid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=ytcoode@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).