Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Michal Nazarewicz
On Thu, Jun 30 2016, Joe Perches wrote: > On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: >> On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > [] >> > tolower macro maps to __tolower function which calls isupper to >> > to determine if character is an upper case letter before

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Michal Nazarewicz
On Thu, Jun 30 2016, Joe Perches wrote: > On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: >> On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > [] >> > tolower macro maps to __tolower function which calls isupper to >> > to determine if character is an upper case letter before

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Andy Shevchenko
On Thu, 2016-06-30 at 13:06 -0700, Joe Perches wrote: > On Thu, 2016-06-30 at 21:42 +0200, Geert Uytterhoeven wrote: > >  > Yeah, that can't work. > Rasmus V wrote the same thing to me offline. Just read the thread and +1 to Rasmus' and Geert's opinion. -- Andy Shevchenko

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Andy Shevchenko
On Thu, 2016-06-30 at 13:06 -0700, Joe Perches wrote: > On Thu, 2016-06-30 at 21:42 +0200, Geert Uytterhoeven wrote: > >  > Yeah, that can't work. > Rasmus V wrote the same thing to me offline. Just read the thread and +1 to Rasmus' and Geert's opinion. -- Andy Shevchenko Intel Finland Oy

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Joe Perches
On Thu, 2016-06-30 at 21:42 +0200, Geert Uytterhoeven wrote: > Hi Joe, Hi Geert. > On Thu, Jun 30, 2016 at 9:26 PM, Joe Perches wrote: [] > > Perhaps _tolower should be used a bit more in lib [] > No, we do care about non-alphabetical characters here. > Using _tolower is

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Joe Perches
On Thu, 2016-06-30 at 21:42 +0200, Geert Uytterhoeven wrote: > Hi Joe, Hi Geert. > On Thu, Jun 30, 2016 at 9:26 PM, Joe Perches wrote: [] > > Perhaps _tolower should be used a bit more in lib [] > No, we do care about non-alphabetical characters here. > Using _tolower is equivalent to ignoring

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Geert Uytterhoeven
Hi Joe, On Thu, Jun 30, 2016 at 9:26 PM, Joe Perches wrote: > On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: >> On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > [] >> > tolower macro maps to __tolower function which calls isupper to >> > to determine if

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Geert Uytterhoeven
Hi Joe, On Thu, Jun 30, 2016 at 9:26 PM, Joe Perches wrote: > On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: >> On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > [] >> > tolower macro maps to __tolower function which calls isupper to >> > to determine if character is an

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Joe Perches
On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: > On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: [] > > tolower macro maps to __tolower function which calls isupper to > > to determine if character is an upper case letter before converting > > it to lower case.  This

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Joe Perches
On Wed, 2016-06-29 at 21:52 +0300, Andy Shevchenko wrote: > On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: [] > > tolower macro maps to __tolower function which calls isupper to > > to determine if character is an upper case letter before converting > > it to lower case.  This

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Zhaoxiu Zeng
On 2016/6/30 2:31, Michal Nazarewicz wrote: > On Thu, Jun 30 2016, zengzhaoxiu wrote: ... >> So this replaces table lookup in tolower with an explicit table lookup >> here while also removing some branches. >> >> Is that an improvement? Hard to say. _ctype table is used by all the >> other

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-30 Thread Zhaoxiu Zeng
On 2016/6/30 2:31, Michal Nazarewicz wrote: > On Thu, Jun 30 2016, zengzhaoxiu wrote: ... >> So this replaces table lookup in tolower with an explicit table lookup >> here while also removing some branches. >> >> Is that an improvement? Hard to say. _ctype table is used by all the >> other

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Andy Shevchenko
On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > On Thu, Jun 30 2016, zengzhaoxiu wrote: > > From: Zhaoxiu Zeng > > > > Signed-off-by: Zhaoxiu Zeng > > --- > >  include/linux/kernel.h | 15 ++- > >  lib/hexdump.c  |

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Andy Shevchenko
On Wed, 2016-06-29 at 20:31 +0200, Michal Nazarewicz wrote: > On Thu, Jun 30 2016, zengzhaoxiu wrote: > > From: Zhaoxiu Zeng > > > > Signed-off-by: Zhaoxiu Zeng > > --- > >  include/linux/kernel.h | 15 ++- > >  lib/hexdump.c  | 36 +++- > >  2

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Michal Nazarewicz
On Thu, Jun 30 2016, zengzhaoxiu wrote: > From: Zhaoxiu Zeng > > Signed-off-by: Zhaoxiu Zeng > --- > include/linux/kernel.h | 15 ++- > lib/hexdump.c | 36 +++- > 2 files changed, 33

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Michal Nazarewicz
On Thu, Jun 30 2016, zengzhaoxiu wrote: > From: Zhaoxiu Zeng > > Signed-off-by: Zhaoxiu Zeng > --- > include/linux/kernel.h | 15 ++- > lib/hexdump.c | 36 +++- > 2 files changed, 33 insertions(+), 18 deletions(-) > > diff --git

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Steven Rostedt
On Thu, 30 Jun 2016 00:15:54 +0800 zengzhao...@163.com wrote: > From: Zhaoxiu Zeng I have to ask, what hot paths call this where we need to add a table for optimization. And there's a chance that this wont even optimize the flow and may even slow down execution as the

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Steven Rostedt
On Thu, 30 Jun 2016 00:15:54 +0800 zengzhao...@163.com wrote: > From: Zhaoxiu Zeng I have to ask, what hot paths call this where we need to add a table for optimization. And there's a chance that this wont even optimize the flow and may even slow down execution as the table will now need to be

[PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- include/linux/kernel.h | 15 ++- lib/hexdump.c | 36 +++- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Andy Shevchenko
On Thu, 2016-06-30 at 00:15 +0800, zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > No way. At least commit message. And prerequisite is the performance / memory foot print tests. > Signed-off-by: Zhaoxiu Zeng > --- >  include/linux/kernel.h |

[PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- include/linux/kernel.h | 15 ++- lib/hexdump.c | 36 +++- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index

Re: [PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread Andy Shevchenko
On Thu, 2016-06-30 at 00:15 +0800, zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > No way. At least commit message. And prerequisite is the performance / memory foot print tests. > Signed-off-by: Zhaoxiu Zeng > --- >  include/linux/kernel.h | 15 ++- >  lib/hexdump.c  |