From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-ide <linux-ide@vger.kernel.org>,
linux-netdev <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>, Jeff Garzik <jeff@garzik.org>,
Ingo Molnar <mingo@elte.hu>,
Jason Wessel <jason.wessel@windriver.com>,
David Howells <dhowells@redhat.com>,
"ralf@linux-mips.org" <ralf@linux-mips.org>,
Paul Mundt <lethal@linux-sh.org>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 01/12] lib: create common ascii hex array
Date: Tue, 13 May 2008 12:55:05 +0300 (EEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0805122218240.14152@wrl-59.cs.helsinki.fi> (raw)
In-Reply-To: <1210619134.24092.51.camel@brick>
On Mon, 12 May 2008, Harvey Harrison wrote:
> Add a common hex array in hexdump.c so everyone can use it.
>
> Add a common hi/lo helper to avoid the shifting masking that is
> done to get the upper and lower nibbles of a byte value.
>
> Pull the pack_hex_byte helper from kgdb as it is opencoded many
> places in the tree that will be consolidated.
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 4d46e29..792bf0a 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -276,7 +276,17 @@ 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[];
> +#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
> +#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
> +
> +static inline char *pack_hex_byte(char *buf, u8 byte)
> +{
> + *buf++ = hex_asc_hi(byte);
> + *buf++ = hex_asc_lo(byte);
> + return buf;
> +}
Any idea how much this will bloat kernel once it has, lets say 100
users? 5k, 10k?
--
i.
next prev parent reply other threads:[~2008-05-13 9:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-12 19:05 [PATCH 01/12] lib: create common ascii hex array Harvey Harrison
2008-05-12 20:41 ` Paul Mundt
2008-05-13 9:55 ` Ilpo Järvinen [this message]
2008-05-13 16:53 ` Harvey Harrison
2008-05-14 11:26 ` David Howells
2008-05-15 9:51 ` Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0805122218240.14152@wrl-59.cs.helsinki.fi \
--to=ilpo.jarvinen@helsinki.fi \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=bzolnier@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=harvey.harrison@gmail.com \
--cc=jason.wessel@windriver.com \
--cc=jeff@garzik.org \
--cc=lethal@linux-sh.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).