linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: "Leonardo Brás" <leobras.c@gmail.com>
Cc: helen@koikeco.de, lkcamp@lists.libreplanetbr.org,
	X86 ML <x86@kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Matthew Wilcox <willy6545@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Andy Lutomirski <luto@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [Lkcamp] [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing.
Date: Fri, 19 Oct 2018 11:44:06 +0900	[thread overview]
Message-ID: <CAK7LNAQ58ZMjFmyNDNmtE+KaQE_LAqo1aRQ-4WpnUsgJSjNT6g@mail.gmail.com> (raw)
In-Reply-To: <CADvQ+rGwns4nFjA8wMRC-mY69_Rr8wwdM8dezx0vpdjUymKqSQ@mail.gmail.com>

On Thu, Oct 18, 2018 at 11:04 AM Leonardo Bras <leobras.c@gmail.com> wrote:
>
> Hello Helen,
>
> On Wed, Oct 17, 2018 at 12:06 AM Helen Koike <helen@koikeco.de> wrote:
> >
> > Hi Leonardo,
> >
> > On 10/16/18 9:09 PM, Leonardo Brás wrote:
> > >     Removes an unnecessary shadowed local variable (start).
> > >     Optimize test of isdigit:
> > >     - If isalpha returns true, isdigit will return false, so no need to test.
> >
> > This patch does two different things, it should be in two separated patches.
> Sure, no problem.
>
> >
> > >
> > > Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
> > > ---
> > >  scripts/asn1_compiler.c | 7 +++----
> > >  1 file changed, 3 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
> > > index c146020fc783..08bb6e5fd6ad 100644
> > > --- a/scripts/asn1_compiler.c
> > > +++ b/scripts/asn1_compiler.c
> > > @@ -413,7 +413,7 @@ static void tokenise(char *buffer, char *end)
> > >
> > >                       /* Handle string tokens */
> > >                       if (isalpha(*p)) {
> > > -                             const char **dir, *start = p;
> > > +                             const char **dir;
> > >
> > >                               /* Can be a directive, type name or element
> > >                                * name.  Find the end of the name.
> > > @@ -454,10 +454,9 @@ static void tokenise(char *buffer, char *end)
> > >
> > >                               tokens[tix++].token_type = TOKEN_TYPE_NAME;
> > >                               continue;
> > > -                     }
> > > +                     } else if (isdigit(*p)) {
> > > +                             /* Handle numbers */
> >
> > Actually you can't do that, p is being altered in the first if statement.
>
> Yeah, you are right. I will remove this logic for v2.


I drop v1 from my tree.

Please send v2.


> >
> > >
> > > -                     /* Handle numbers */
> > > -                     if (isdigit(*p)) {
> > >                               /* Find the end of the number */
> > >                               q = p + 1;
> > >                               while (q < nl && (isdigit(*q)))
> > >
> >
> > Regards
> > Helen
>
> Thanks!
>
> Leonardo Brás



-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2018-10-19  2:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17  0:09 [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing Leonardo Brás
2018-10-17  3:06 ` [Lkcamp] " Helen Koike
2018-10-18  2:03   ` Leonardo Bras
2018-10-19  2:44     ` Masahiro Yamada [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=CAK7LNAQ58ZMjFmyNDNmtE+KaQE_LAqo1aRQ-4WpnUsgJSjNT6g@mail.gmail.com \
    --to=yamada.masahiro@socionext.com \
    --cc=bp@alien8.de \
    --cc=helen@koikeco.de \
    --cc=hpa@zytor.com \
    --cc=leobras.c@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcamp@lists.libreplanetbr.org \
    --cc=luto@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=willy6545@gmail.com \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).