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

From: Harvey Harrison
Date: Thu May 01 2008 - 17:35:37 EST


On Thu, 2008-05-01 at 14:28 -0700, Joe Perches wrote:
> 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@xxxxxxxxx>
> > ---
> > 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.
>
>

The whole point is to start to centralize everybody's private copy of
a hex_asc equivalent.

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/