From mboxrd@z Thu Jan 1 00:00:00 1970 From: adobriyan@gmail.com (Alexey Dobriyan) Date: Fri, 23 Feb 2018 21:20:06 +0300 Subject: [v2,1/1] ARM: orion5x: use mac_pton() helper In-Reply-To: <1519399128.10722.111.camel@linux.intel.com> References: <1443795153-40836-1-git-send-email-andriy.shevchenko@linux.intel.com> <099870d3-e2bd-aad9-d526-5438596bb575@the2masters.de> <20180222214237.GH28112@lunn.ch> <20180222233457.GA6052@lunn.ch> <1519380573.10722.94.camel@linux.intel.com> <20180223150147.GA17857@lunn.ch> <1519399128.10722.111.camel@linux.intel.com> Message-ID: <20180223182006.GA2116@avx2> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 . > > > > > > 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.