All of lore.kernel.org
 help / color / mirror / Atom feed
From: adobriyan@gmail.com (Alexey Dobriyan)
To: linux-arm-kernel@lists.infradead.org
Subject: [v2,1/1] ARM: orion5x: use mac_pton() helper
Date: Fri, 23 Feb 2018 21:20:06 +0300	[thread overview]
Message-ID: <20180223182006.GA2116@avx2> (raw)
In-Reply-To: <1519399128.10722.111.camel@linux.intel.com>

On Fri, Feb 23, 2018 at 05:18:48PM +0200, Andy Shevchenko wrote:
> +Cc Alexey
> 
> On Fri, 2018-02-23 at 16:01 +0100, Andrew Lunn wrote:
> > > > The patch has been corrupted by you email client. But otherwise,
> > > > yes.
> > > > 
> > > > Please take a look at:
> > > > 
> > > > https://www.kernel.org/doc/html/v4.12/process/submitting-patches.h
> > > > tml
> > > > 
> > > > It will give you hits about correctly formatting the patch. In
> > > > addition it should have:
> > > > 
> > > > Fixes: 4cd5773a2ae6 ("net: core: move mac_pton() to
> > > > lib/net_utils.c")
> > > > 
> > > > before the --- line, to indicate what it is fixing.
> > > > 
> > > > This patch should be against
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git,
> > > > since it is a fix, and sent to <netdev@vger.kernel.org>.
> > > 
> > > Guys, consider this one instead:
> > > https://patchwork.ozlabs.org/patch/851008/
> > 
> > Hi Andy
> > 
> > Thanks for pointing this patch out.
> > 
> > What is the advantage of doing to the strnlen()? As Stefan says, the
> > code which follows will detect a short string, in that a NULL is not
> > in [0-9a-f], nor a : .
> 
> I'm not sure, but my understanding is that, the strchr() call in the
> original code or isxdigit() in the follow up change will trash a cache a
> bit. Besides that some of the users are (often?) supplying empty strings
> to convert from, and in this case makes sense to bail out fast.
> 
> Alexey, can you shed a light here?

I went for the simplest code.
map_pton() is never on the fastpath, so code size matters more.

In this sense, conversion to mac_pton() should be done, and strnlen()
probably should not.

  parent reply	other threads:[~2018-02-23 18:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 14:12 [PATCH v2 1/1] ARM: orion5x: use mac_pton() helper Andy Shevchenko
2015-10-13 11:27 ` Detlef Vollmann
2015-10-15  7:51   ` Gregory CLEMENT
2018-02-22 17:45 ` [v2,1/1] " Stefan Hellermann
2018-02-22 21:42   ` Andrew Lunn
2018-02-22 23:18     ` Stefan Hellermann
2018-02-22 23:34       ` Andrew Lunn
2018-02-23 10:09         ` Andy Shevchenko
2018-02-23 15:01           ` Andrew Lunn
2018-02-23 15:18             ` Andy Shevchenko
2018-02-23 15:51               ` Andrew Lunn
2018-02-23 16:36                 ` Stefan Hellermann
2018-02-23 16:57                   ` Andy Shevchenko
2018-02-23 17:23                   ` Andrew Lunn
2018-02-23 18:20               ` Alexey Dobriyan [this message]
2018-02-23 20:17                 ` [PATCH] net: Allow mac_pton() to work on non-NULL terminated strings Stefan Hellermann
2018-02-23 20:17                   ` Stefan Hellermann
2018-02-23 20:17                   ` Stefan Hellermann
2018-02-23 20:27                   ` Andrew Lunn
2018-02-23 20:27                     ` Andrew Lunn
2018-02-23 20:27                     ` Andrew Lunn
2018-02-23 20:41                   ` Alexey Dobriyan
2018-02-23 20:41                     ` Alexey Dobriyan
2018-02-23 20:41                     ` Alexey Dobriyan
2018-02-23 20:51                     ` Andy Shevchenko
2018-02-23 20:51                       ` Andy Shevchenko
2018-02-23 20:51                       ` Andy Shevchenko
2018-02-26 18:37                   ` David Miller
2018-02-26 18:37                     ` David Miller

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=20180223182006.GA2116@avx2 \
    --to=adobriyan@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.