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

From: Linus Torvalds
Date: Wed May 09 2012 - 13:15:29 EST

On Wed, May 9, 2012 at 6:27 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> + * - 'b' For a bitmap, consumes 2 args, second is int
> + * - 'bc' For a cpumask
> + * - 'bn' For a nodemask

Hard NAK.

No way. The "consumes 2 args" is fundamentally idiotic, since it
forces compiler warnings. The whole idea of %pXX was that you can give
it any pointer, because all that the compiler cares about is the "%p"
part, so random pointers to stuff won't break.

Your patch breaks the whole point of the extension.

The "bc" and "bn" would work, except for the fact that I doubt they
are printed out enough to matter.

A "%.*pb" is the only interface that can work for a "sized" bitmap
(with obviously fixed-length ones being possible with a "%.32bp" like

But the whole va_args games you play are not acceptable. %p *will*
continue to take a void *, and nothing else.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at