public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: msuchanek <msuchanek@suse•de>
To: Michael Ellerman <mpe@ellerman•id.au>
Cc: Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	Paul Mackerras <paulus@samba•org>,
	Jonathan Corbet <corbet@lwn•net>, Jessica Yu <jeyu@kernel•org>,
	Rusty Russell <rusty@rustcorp•com.au>,
	Jason Baron <jbaron@akamai•com>,
	Hari Bathini <hbathini@linux•vnet.ibm.com>,
	Mahesh J Salgaonkar <mahesh@linux•vnet.ibm.com>,
	Daniel Axtens <dja@axtens•net>,
	Andrew Morton <akpm@linux-foundation•org>,
	Thiago Jung Bauermann <bauerman@linux•vnet.ibm.com>,
	Balbir Singh <bsingharora@gmail•com>,
	Nicholas Piggin <npiggin@gmail•com>,
	Michael Neuling <mikey@neuling•org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>,
	Christophe Leroy <christophe.leroy@c-s•fr>,
	Scott Wood <oss@buserror•net>,
	Oliver O'Halloran <oohall@gmail•com>,
	David Howells <dhowells@redhat•com>,
	Sylvain 'ythier' Hitier <sylvain.hitier@gmail•com>,
	Ingo Molnar <mingo@kernel•org>, Kees Cook <keescook@chromium•org>,
	Thomas Gleixner <tglx@linutronix•de>, Baoquan He <bhe@redhat•com>,
	linux-doc@vger•kernel.org, Lokesh Vutla <lokeshvutla@ti•com>,
	Viresh Kumar <viresh.kumar@linaro•org>,
	linux-kernel@vger•kernel.org, "Steven Rostedt,
	" <rostedt@goodmis•org>, Tejun Heo <tj@kernel•org>,
	Ilya Matveychikov <matvejchikov@gmail•com>,
	linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH v7 3/4] lib/cmdline.c Remove quotes symmetrically.
Date: Thu, 24 Aug 2017 14:15:20 +0200	[thread overview]
Message-ID: <20170824141520.449e9f63@naga> (raw)
In-Reply-To: <87valdut2g.fsf@concordia.ellerman.id.au>

On Thu, 24 Aug 2017 21:02:47 +1000
Michael Ellerman <mpe@ellerman•id.au> wrote:

> Michal Suchanek <msuchanek@suse•de> writes:
> 
> > Remove quotes from argument value only if there is qoute on both
> > sides.
> >
> > Signed-off-by: Michal Suchanek <msuchanek@suse•de>
> > ---
> >  arch/powerpc/kernel/fadump.c | 6 ++----
> >  lib/cmdline.c                | 7 ++-----  
> 
> Can you split that into two patches?

Not really. There is logic in lib/cmdline.c which is duplicated in
arch/powerpc/kernel/fadump.c and so the two places should be updated in
sync. 

Thanks

Michal

> 
> cheers
> 
> >  2 files changed, 4 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/fadump.c
> > b/arch/powerpc/kernel/fadump.c index a1614d9b8a21..d7da4ce9f7ae
> > 100644 --- a/arch/powerpc/kernel/fadump.c
> > +++ b/arch/powerpc/kernel/fadump.c
> > @@ -489,10 +489,8 @@ static void __init fadump_update_params(struct
> > param_info *param_info, *tgt++ = ' ';
> >  
> >  	/* next_arg removes one leading and one trailing '"' */
> > -	if (*tgt == '"')
> > -		shortening += 1;
> > -	if (*(tgt + vallen + shortening) == '"')
> > -		shortening += 1;
> > +	if ((*tgt == '"') && (*(tgt + vallen + shortening) == '"'))
> > +		shortening += 2;
> >  
> >  	/* remove one leading and one trailing quote if both are
> > present */ if ((val[0] == '"') && (val[vallen - 1] == '"')) {
> > diff --git a/lib/cmdline.c b/lib/cmdline.c
> > index 4c0888c4a68d..01e701b2afe8 100644
> > --- a/lib/cmdline.c
> > +++ b/lib/cmdline.c
> > @@ -227,14 +227,11 @@ char *next_arg(char *args, char **param, char
> > **val) *val = args + equals + 1;
> >  
> >  		/* Don't include quotes in value. */
> > -		if (**val == '"') {
> > +		if ((**val == '"') && (args[i-1] == '"')) {
> >  			(*val)++;
> > -			if (args[i-1] == '"')
> > -				args[i-1] = '\0';
> > +			args[i-1] = '\0';
> >  		}
> >  	}
> > -	if (quoted && args[i-1] == '"')
> > -		args[i-1] = '\0';
> >  
> >  	if (args[i]) {
> >  		args[i] = '\0';
> > -- 
> > 2.10.2  

  reply	other threads:[~2017-08-24 12:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 20:14 [PATCH v7 1/4] powerpc/fadump: reduce memory consumption for capture kernel Michal Suchanek
2017-08-17 20:14 ` [PATCH v7 2/4] powerpc/fadump: update documentation about 'fadump_extra_args=' parameter Michal Suchanek
2017-08-17 20:14 ` [PATCH v7 3/4] lib/cmdline.c Remove quotes symmetrically Michal Suchanek
2017-08-17 21:27   ` msuchanek
2017-08-21 10:27   ` Baoquan He
2017-08-21 11:30     ` Michal Suchánek
2017-08-24 11:02   ` Michael Ellerman
2017-08-24 12:15     ` msuchanek [this message]
2017-08-17 20:14 ` [PATCH v7 4/4] boot/param: add pointer to next argument to unknown parameter callback Michal Suchanek
2017-08-24 11:04   ` Michael Ellerman
2017-08-24 12:17     ` msuchanek
2017-08-18 10:50 ` [PATCH v7 1/4] powerpc/fadump: reduce memory consumption for capture kernel Hari Bathini
2017-08-18 11:57   ` Michal Suchánek
2017-08-18 14:00     ` Hari Bathini

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=20170824141520.449e9f63@naga \
    --to=msuchanek@suse$(echo .)de \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=bauerman@linux$(echo .)vnet.ibm.com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=bhe@redhat$(echo .)com \
    --cc=bsingharora@gmail$(echo .)com \
    --cc=christophe.leroy@c-s$(echo .)fr \
    --cc=corbet@lwn$(echo .)net \
    --cc=dhowells@redhat$(echo .)com \
    --cc=dja@axtens$(echo .)net \
    --cc=hbathini@linux$(echo .)vnet.ibm.com \
    --cc=jbaron@akamai$(echo .)com \
    --cc=jeyu@kernel$(echo .)org \
    --cc=keescook@chromium$(echo .)org \
    --cc=linux-doc@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=lokeshvutla@ti$(echo .)com \
    --cc=mahesh@linux$(echo .)vnet.ibm.com \
    --cc=matvejchikov@gmail$(echo .)com \
    --cc=mikey@neuling$(echo .)org \
    --cc=mingo@kernel$(echo .)org \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=npiggin@gmail$(echo .)com \
    --cc=oohall@gmail$(echo .)com \
    --cc=oss@buserror$(echo .)net \
    --cc=paulus@samba$(echo .)org \
    --cc=rostedt@goodmis$(echo .)org \
    --cc=rusty@rustcorp$(echo .)com.au \
    --cc=sylvain.hitier@gmail$(echo .)com \
    --cc=tglx@linutronix$(echo .)de \
    --cc=tj@kernel$(echo .)org \
    --cc=viresh.kumar@linaro$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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