Re: [PATCH 8/9] x86: ramdisk info print with high bits.

H. Peter Anvin
2012-11-16T20:10:13Z

Use %#010llx

Yinghai Lu <yinghai@kernel.org> wrote:

>On Fri, Nov 16, 2012 at 11:39 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>> On 11/16/2012 11:21 AM, Yinghai Lu wrote:
>>>>
>>>> NAK, this is expected to match the resource print format (%pR),
>which
>>>> prints 10 digits by default and then expands. Furthermore,
>printing
>>>> *18* digits is downright silly since we still don't have 72-bit
>addressing.
>>>
>>> that is the same as in e820_print_map::
>>>
>>> printk(KERN_INFO "%s: [mem %#018Lx-%#018Lx] ", who,
>>> (unsigned long long) e820.map[i].addr,
>>> (unsigned long long)
>>> (e820.map[i].addr + e820.map[i].size - 1));
>>>
>>>
>>> that is for 64bit address.
>>> that extra 2 is for "0x"
>>>
>>
>> Oh, right. It's the use of %#... I usually use 0x%... so I didn't
>think
>> of it.
>>
>>> or you prefer to cast them to pointer and use %pR for them all?
>>>
>>> or fix printk to add extra 2 for "0x" when # is found?
>>
>> We should normally use %pR or the equivalent format. The only reason
>we
>> do it different for e820_print_map is because it prints a whole bunch
>of
>> lines in which we want the columns to line up.
>
>so we just use #llx or #Lx instead in this patch?

--
Sent from my mobile phone. Please excuse brevity and lack of formatting.