mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Laura Abbott <lauraa@codeaurora.org>,
	Gargi Sharma <gs051095@gmail.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init/main.c: simplify repair_env_string
Date: Fri, 4 May 2018 18:08:37 +0200	[thread overview]
Message-ID: <20180504180837.346cd966@kitsune.suse.cz> (raw)
In-Reply-To: <20180504114035.111ad8f7@gandalf.local.home>

On Fri, 4 May 2018 11:40:35 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Cleaning out my INBOX, I stumbled across this old patch.
> 
> On Fri, 15 Dec 2017 22:33:17 +0100
> Michal Suchanek <msuchanek@suse.de> wrote:
> 
> > Quoting characters are now removed from the parameter so value
> > always follows directly after the NUL terminating parameter name.
> > 
> > Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> > ---
> >  init/main.c | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> > 
> > Since the previous "[PATCH v9 3/8] lib/cmdline.c: add backslash
> > support to kernel commandline parsing" adds the memmove in
> > lib/cmdline.c it is now superfluous in init/main.c  
> 
> I don't believe the above patches were ever applied. Were they?

No, they weren't.

The reason to write them was to support the fadump_extra_args argument
with peculiar semantics that required the quoting cleanup in kernel
argument parsing.

A different solution for the fadump memory consumption is in the works
so I dropped this. There was lack of interest from reviewers, too.

Thanks

Michal

> 
> -- Steve
> 
> > 
> > diff --git a/init/main.c b/init/main.c
> > index 1f5fdedbb293..1e5b1dc940d9 100644
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -244,15 +244,10 @@ static int __init repair_env_string(char
> > *param, char *val, const char *unused, void *arg)
> >  {
> >  	if (val) {
> > -		/* param=val or param="val"? */
> > -		if (val == param+strlen(param)+1)
> > -			val[-1] = '=';
> > -		else if (val == param+strlen(param)+2) {
> > -			val[-2] = '=';
> > -			memmove(val-1, val, strlen(val)+1);
> > -			val--;
> > -		} else
> > -			BUG();
> > +		int parm_len = strlen(param);
> > +
> > +		param[parm_len] = '=';
> > +		BUG_ON(val != param + parm_len + 1);
> >  	}
> >  	return 0;
> >  }  
> 

  reply	other threads:[~2018-05-04 16:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 15:16 [PATCH v9 0/8] reduce memory consumption for powerpc firmware-assisted capture kernel Hari Bathini
2017-11-15 15:16 ` [PATCH v9 1/8] lib/cmdline.c: remove quotes symmetrically Hari Bathini
2017-12-15 20:51   ` Michal Suchánek
2017-11-15 15:17 ` [PATCH v9 2/8] boot/param: add pointer to current and next argument to unknown parameter callback Hari Bathini
2017-12-15 20:47   ` Michal Suchánek
2017-12-15 21:41     ` [PATCH] Fix parse_args cycle limit check Michal Suchanek
2017-12-15 23:49       ` Randy Dunlap
2017-12-18 17:34         ` Michal Suchánek
2017-12-18 17:57           ` Randy Dunlap
2017-11-15 15:17 ` [PATCH v9 3/8] lib/cmdline.c: add backslash support to kernel commandline parsing Hari Bathini
2017-12-15 21:33   ` [PATCH] init/main.c: simplify repair_env_string Michal Suchanek
2018-05-04 15:40     ` Steven Rostedt
2018-05-04 16:08       ` Michal Suchánek [this message]
2017-11-15 15:17 ` [PATCH v9 4/8] Documentation/admin-guide: backslash support in commandline Hari Bathini
2017-11-15 15:18 ` [PATCH v9 5/8] lib/cmdline.c: implement single quotes in commandline argument parsing Hari Bathini
2017-12-15 21:49   ` [PATCH] Optimize final quote removal Michal Suchanek
2017-11-15 15:18 ` [PATCH v9 6/8] Documentation/admin-guide: single quotes in kernel arguments Hari Bathini
2017-11-15 15:19 ` [PATCH v9 7/8] powerpc/fadump: reduce memory consumption for capture kernel Hari Bathini
2017-11-15 15:19 ` [PATCH v9 8/8] powerpc/fadump: update documentation about 'fadump_extra_args=' parameter Hari Bathini
2022-03-11 17:02 ` [PATCH v9 0/8] reduce memory consumption for powerpc firmware-assisted capture kernel Christophe Leroy

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=20180504180837.346cd966@kitsune.suse.cz \
    --to=msuchanek@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=gs051095@gmail.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=keescook@chromium.org \
    --cc=lauraa@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®