[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACnwZYdBocYEjASpKCNZ6cfLNpzxeLxaVjLCHwxwsYO+P14tAQ@mail.gmail.com>
Date: Sun, 15 Sep 2013 01:27:03 -0300
From: Thiago Farina <tfransosi@...il.com>
To: Andre Naujoks <nautsch2@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Arnd Bergmann <arnd@...db.de>,
"Michael S. Tsirkin" <mst@...hat.com>,
Vladimir Kondratiev <qca_vkondrat@....qualcomm.com>,
Jason Baron <jbaron@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux list <linux-kernel@...r.kernel.org>,
linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net 2/3] lib: introduce upper case hex ascii helpers
On Fri, Sep 13, 2013 at 2:37 PM, Andre Naujoks <nautsch2@...il.com> wrote:
> To be able to use the hex ascii functions in case sensitive environments
> the array hex_asc_upper[] and the needed functions for hex_byte_pack_upper()
> are introduced.
>
> Signed-off-by: Andre Naujoks <nautsch2@...il.com>
> ---
> include/linux/kernel.h | 11 +++++++++++
> lib/hexdump.c | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 482ad2d..672ddc4 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -439,6 +439,17 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
> return buf;
> }
>
> +extern const char hex_asc_upper[];
> +#define hex_asc_upper_lo(x) hex_asc_upper[((x) & 0x0f)]
> +#define hex_asc_upper_hi(x) hex_asc_upper[((x) & 0xf0) >> 4]
Does using a macro instead of a real function (static inline)
generates a better code?
--
Thiago Farina
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists