Re: [RFC][PATCH] printk: Add %pb to print bitmaps

Joe Perches
2012-05-09T14:19:50Z

On Wed, 2012-05-09 at 15:59 +0200, Peter Zijlstra wrote:
> The current implementation limits both (field_width and precision) to
> s16, which will limit us to printing 32Kb bitmaps. If need arises we
> could increase printf_spec size I guess.

Not sure that's a problem really.
A single printk is limited to 1024 bytes.

> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -941,6 +947,26 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> return netdev_feature_string(buf, end, ptr, spec);
> }
> break;
> + case 'b':
> + {
> + int bits, len;

trivia: a tab indent could be avoided by using
case b: {