linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
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 09:53:27 -0700	[thread overview]
Message-ID: <1210697607.5938.1.camel@brick> (raw)
In-Reply-To: <Pine.LNX.4.64.0805122218240.14152@wrl-59.cs.helsinki.fi>

On Tue, 2008-05-13 at 12:55 +0300, Ilpo Järvinen wrote:
> 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>
> > ---
> >  
> > -#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?
> 

No more than the existing users do open-coding the same thing all over
the place.  If it becomes a problem, this can be out-of-lined, but
the savings are not much.

Harvey


  reply	other threads:[~2008-05-13 16:54 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
2008-05-13 16:53   ` Harvey Harrison [this message]
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=1210697607.5938.1.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bzolnier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=ilpo.jarvinen@helsinki.fi \
    --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).