Re: [PATCH 1/4] lib: add ascii hex helper functions

Joe Perches
2008-05-01T21:29:49Z

On Thu, 2008-05-01 at 13:51 -0700, Harvey Harrison wrote:
> Everyone rolls their own version around the tree, centralize
> in lib/hexdump.c
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> include/linux/kernel.h | 6 +++++-
> lib/hexdump.c | 25 +++++++++++++++++++++++--
> 2 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 4d46e29..20cae9a 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -276,7 +276,11 @@ extern void print_hex_dump(const char *level, const char *prefix_str,
> const void *buf, size_t len, bool ascii);
> extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
> const void *buf, size_t len);
> -#define hex_asc(x) "0123456789abcdef"[x]
> +
> +extern const char hex_asc[];

I don't see a reason hex_asc should be extern.
It's only used by hexdump.
I think it better to remove hex_asc from kernel.h altogether.