Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: Paul Jackson <pj@...>, <yhlu.kernel@...>, <akpm@...>, <mingo@...>, <tglx@...>, <steiner@...>, <travis@...>, <linux-kernel@...>, <ying.huang@...>, <andi@...>
Date: Tuesday, June 24, 2008 - 10:58 pm

On Tue, 24 Jun 2008, H. Peter Anvin wrote:

Actually, I'd like to make %p produce the format that you right now have 
to jump through insane hoops for: symbolic addresses.

Right now you have to do something insane like

	print_symbol(KERN_WARNING "address: %s\n", ptr);

to print a symbolic version, and it sucks because it's actually just able 
to print symbols, you cannot mix any other types in there.

I think it would be much easier to use if "%p" just did the symbolic 
version (if it's relevant) automatically. If you _just_ want the hex 
representation, you can already always just use %#lx and a cast.

(Of course, then for things that we can't make into symbolic names, we'd 
have to fall back to just the hex representation, and whether that one 
then includes the 0x or not I don't have strong opinions on.)

And yes, to avoid messing with current users, maybe we should only do that 
with %#p (which I don't think anybody uses right now, although I suspect 
it actually adds the '0x' you'd like). The '#' thing is, of course, all 
about 'alternate forms'. But I worry that gcc warns about undefined 
formatting behavior.

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not d..., Linus Torvalds, (Tue Jun 24, 10:58 pm)
Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not d..., Alexander van Heukelum, (Mon Jun 30, 3:58 am)
[PATCH 2/5 v2] x86 boot: x86_64 efi compiler warning fix, Paul Jackson, (Sun Jun 22, 10:22 am)
[PATCH 1/5 v2] x86 boot: e820 code indentation fix, Paul Jackson, (Sun Jun 22, 10:21 am)