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

From: Ingo Molnar
Date: Wed May 09 2012 - 11:34:32 EST



* Joe Perches <joe@xxxxxxxxxxx> wrote:

> 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: {

Nit: 'b'.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/