[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1214408065.21847.30.camel@johannes.berg>
Date: Wed, 25 Jun 2008 17:34:25 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul Jackson <pj@....com>, hpa@...or.com, yhlu.kernel@...il.com,
akpm@...ux-foundation.org, mingo@...e.hu, tglx@...utronix.de,
steiner@....com, travis@....com, linux-kernel@...r.kernel.org,
ying.huang@...el.com, andi@...stfloor.org
Subject: Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal
in some kernel info printks
On Wed, 2008-06-25 at 08:19 -0700, Linus Torvalds wrote:
>
> On Wed, 25 Jun 2008, Johannes Berg wrote:
> >
> > In networking, we've gone through various incarnations of print_mac()
> > which is similar to the sym() macro Paul proposed, and it turned out to
> > be undesirable because of the way it interacts with static inlines that
> > only optionally contain code at all, the print_mac() function call is
> > still emitted by the compiler. People experimented with marking it
> > __pure but that had other problems.
>
> You don't even have to go that esoteric.
>
> Just printing things like "sector_t" or "u64" is painful, because the
> exact type depends on config options and/or architecture.
Heh, true, but I have the print_mac() disaster firmly imprinted in my
mind ;)
> > It would be nice to be able to say
> >
> > u8 *eaddr;
> >
> > printk(... %M ..., eaddr);
>
> For special things, I do think we should extend the format more, and
> forget about single-character names. It would be lovely to do them as
> %[mac], %[u64], %[symbol] or similar. Because once you don't rely on gcc
> checking the string, you can do it.
True, that does look a lot better and has less potential for confusion.
> The problem is that right now we absolutely _do_ rely on gcc checking the
> string, and as such we're forced to use standard patterns, and standard
> patterns _only_. And that means that %M isn't an option, but also that if
> we want symbolic names we'd have to use %p, and not some extension.
>
> But once you drop the 'standard patterns' requirement, I do think you
> should drop it _entirely_, and not just extend it with some pissant
> single-character unreadable mess.
Oh yes, I agree. At one point I figured it should be easy enough to
extend gcc with something that allows you to specify the format
character/type to take but alas, such a thing is not possible.
johannes
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists