[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240411230745.dba6cfa97ec068d909550fd5@kernel.org>
Date: Thu, 11 Apr 2024 23:07:45 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Yuntao Wang <ytcoode@...il.com>, linux-kernel@...r.kernel.org, Thomas
Gleixner <tglx@...utronix.de>, "Peter Zijlstra (Intel)"
<peterz@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>, Josh
Poimboeuf <jpoimboe@...nel.org>, "ndesaulniers@...gle.com"
<ndesaulniers@...gle.com>, Tejun Heo <tj@...nel.org>, Christophe Leroy
<christophe.leroy@...roup.eu>, Krister Johansen <kjlx@...pleofstupid.com>,
Changbin Du <changbin.du@...wei.com>, Arnd Bergmann <arnd@...db.de>, Masami
Hiramatsu <mhiramat@...nel.org>, Linux Trace Kernel
<linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH] init/main.c: Remove redundant space from
saved_command_line
On Thu, 11 Apr 2024 09:19:32 +0200
Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> CC Hiramatsu-san (now for real :-)
Thanks!
>
> On Thu, Apr 11, 2024 at 6:13 AM Yuntao Wang <ytcoode@...il.com> wrote:
> > extra_init_args ends with a space, so when concatenating extra_init_args
> > to saved_command_line, be sure to remove the extra space.
Hi Yuntao,
Hmm, if you want to trim the end space, you should trim extra_init_args
itself instead of this adjustment. Also, can you share the example?
Thank you,
> >
> > Signed-off-by: Yuntao Wang <ytcoode@...il.com>
> > ---
> > init/main.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/init/main.c b/init/main.c
> > index 2ca52474d0c3..cf2c22aa0e8c 100644
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -660,12 +660,14 @@ static void __init setup_command_line(char *command_line)
> > strcpy(saved_command_line + len, extra_init_args);
> > len += ilen - 4; /* strlen(extra_init_args) */
> > strcpy(saved_command_line + len,
> > - boot_command_line + initargs_offs - 1);
> > + boot_command_line + initargs_offs);
> > } else {
> > len = strlen(saved_command_line);
> > strcpy(saved_command_line + len, " -- ");
> > len += 4;
> > strcpy(saved_command_line + len, extra_init_args);
> > + len += ilen - 4; /* strlen(extra_init_args) */
> > + saved_command_line[len-1] = '\0'; /* remove trailing space */
> > }
> > }
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68korg
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists