All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Li Zefan <lizf@cn.fujitsu.com>, Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Zhaolei <zhaolei@cn.fujitsu.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Vegard Nossum <vegard.nossum@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: printk %0*X is broken.
Date: Wed, 6 May 2009 18:11:19 +0200	[thread overview]
Message-ID: <20090506161116.GA5997@nowhere> (raw)
In-Reply-To: <4A014A9D.8000903@cn.fujitsu.com>

On Wed, May 06, 2009 at 04:30:21PM +0800, Li Zefan wrote:
> 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.


Indeed, a negative value given as the width will actually pad to the
right (reverse width forcing).
If you have -3, that matches the normal printf behaviour.

Yinghai, could you check please if that's the case for you? 

Thanks,

Frederic.


  reply	other threads:[~2009-05-06 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  7:06 printk %0*X is broken Yinghai Lu
2009-05-06  7:18 ` Ingo Molnar
2009-05-06  8:00   ` Li Zefan
2009-05-06  8:12   ` Vegard Nossum
2009-05-06  8:27     ` Lai Jiangshan
2009-05-06  8:34       ` Li Zefan
2009-05-06  9:20         ` Vegard Nossum
2009-05-06  8:30   ` Li Zefan
2009-05-06 16:11     ` Frederic Weisbecker [this message]
2009-05-07  4:36       ` [PATCH] x86: fix compute high_width with phys-addr is 44bit and more Yinghai Lu
2009-05-11  9:54         ` [tip:x86/urgent] x86: mtrr: Fix high_width computation when phys-addr is >= 44bit tip-bot for Yinghai Lu
2009-05-06 10:25   ` printk %0*X is broken Frédéric Weisbecker

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=20090506161116.GA5997@nowhere \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=vegard.nossum@gmail.com \
    --cc=yinghai@kernel.org \
    --cc=zhaolei@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.