Re: [PATCH] docs: printk-formats: Clarify %*pb format parameters

From: Andy Shevchenko
Date: Wed May 17 2023 - 12:21:18 EST


On Tue, May 16, 2023 at 08:52:43AM +0200, Luca Weiss wrote:
> Since it's rather unusual for printk formats to require two parameters,

I don't think this is "unusual". The %*... is very well described in the
printf(3) (the meaning of *). It applies here for %*p... as well.

> expand the documentation to clearly mention that in the printk format
> for bitmaps.
>
> As an extra example, for example from include/net/bluetooth/hci_core.h
> we have a bitmap DECLARE_BITMAP(dev_flags, __HCI_NUM_FLAGS);
> This can be printed with ("%*pb", __HCI_NUM_FLAGS, hdev->dev_flags)

I think this change is not needed. But try to convince PRINTK maintainers.
Maybe they will be okay with it if it covers all %*p... cases (like %*ph).

--
With Best Regards,
Andy Shevchenko