lkml.org 
[lkml]   [2009]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk %0*X is broken.
Ingo Molnar wrote:
> Cc:-ed more folks who modified lib/vsprintf.c recently.
>
> Ingo
>
> * Yinghai Lu <yinghai@kernel.org> wrote:
>
>> it seems someone broke
>>
>> printk( "%0*X\n", width, x);
>>
>> looks like 0 is dumped.
>>
>> YH
>>
>> [ 0.000000] MTRR variable ranges enabled:
>> [ 0.000000] 0 base 0 00000000 mask FF0 00000000 write-back
>> [ 0.000000] 1 base 10 00000000 mask FFF 80000000 write-back
>> [ 0.000000] 2 base 0 80000000 mask FFF 80000000 uncachable
>> [ 0.000000] 3 base 0 7F800000 mask FFF FF800000 uncachable
>>

2.6.30-rc4-tip, the output of my box:

high_width: 1
MTRR variable ranges enabled:
0 base 000000000 mask FC0000000 write-back
1 base 03C000000 mask FFC000000 uncachable
2 base 0D0000000 mask FF8000000 write-combining

Is it possible that high_width is negative in your output?
If high_width == -3, we can get exactly the same output with yours.

>>
>> code:
>> for (i = 0; i < num_var_ranges; ++i) {
>> if (mtrr_state.var_ranges[i].mask_lo & (1 << 11))
>> printk(KERN_DEBUG " %u base %0*X%05X000 mask %0*X%05X000 %s\n",
>> i,
>> high_width,
>> mtrr_state.var_ranges[i].base_hi,
>> mtrr_state.var_ranges[i].base_lo >> 12,
>> high_width,
>> mtrr_state.var_ranges[i].mask_hi,
>> mtrr_state.var_ranges[i].mask_lo >> 12,
>> mtrr_attrib_to_str(mtrr_state.var_ranges[i].base_lo & 0xff));
>> else
>> printk(KERN_DEBUG " %u disabled\n", i);
>> }
>>
>
>


\
 
 \ /
  Last update: 2009-05-06 10:33    [W:0.046 / U:52.080 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site