lkml.org 
[lkml]   [2012]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] printk: Add %pb to print bitmaps
From
Date
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.




\
 
 \ /
  Last update: 2012-05-09 17:01    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site