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

Linus Torvalds
2012-05-09T17:15:35Z

On Wed, May 9, 2012 at 6:27 AM, Peter Zijlstra <peterz@infradead.org> 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
thing)

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

Linus