[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1336573457.2527.50.camel@twins>
Date: Wed, 09 May 2012 16:24:17 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: Igor Mammedov <imammedo@...hat.com>, Jiang Liu <liuj97@...il.com>,
linux-kernel@...r.kernel.org, pjt@...gle.com, tglx@...utronix.de,
seto.hidetoshi@...fujitsu.com,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC][PATCH] printk: Add %pb to print bitmaps
On Wed, 2012-05-09 at 16:15 +0200, Ingo Molnar wrote:
> So, if someone specifies an incomplete "%pb" format - fmt[1]
> will be 0 and we take precision as the length - presumably also
> 0.
yes, printf_spec is initialized to 0s.
> We stick that 0 into:
>
> > + len = bitmap_scnlistprintf(buf, end - buf, ptr, bits);
>
> Will that work?
Yes, bitmap_scnlistprintf() will only set buf[0] = 0 (which will be
overwritten by a possible next printf token) and return 0 length not
advancing the ptr.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists