[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CSSLOC8WDIPE.1WO9BXZQA7A12@otso>
Date: Mon, 22 May 2023 08:41:51 +0200
From: "Luca Weiss" <luca.weiss@...rphone.com>
To: "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>
Cc: "Petr Mladek" <pmladek@...e.com>,
"Steven Rostedt" <rostedt@...dmis.org>,
"Sergey Senozhatsky" <senozhatsky@...omium.org>,
"Rasmus Villemoes" <linux@...musvillemoes.dk>,
"Jonathan Corbet" <corbet@....net>,
<~postmarketos/upstreaming@...ts.sr.ht>,
<phone-devel@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] docs: printk-formats: Clarify %*pb format parameters
On Wed May 17, 2023 at 6:19 PM CEST, Andy Shevchenko wrote:
> 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".
Well, unusual for me at least. I've never really used anything except
the standard integer types and %px. And I've been contributing to the
kernel since 2017.
> The %*... is very well described in the printf(3) (the meaning of *).
> It applies here for %*p... as well.
The printf(3) man page is never mentioned on this docs page. And even if
it would be mentioned somewhere, I doubt anyone is reading most of the
page when they're just looking for a format specifier for e.g. bitmap.
At least I am not.
>
> > 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).
Cannot say I haven't tried :) As I wrote in the initial email I'd be
happy also if someone who knows more about the formats to include some
text for all the %* options so users know what's up.
Regards
Luca
Powered by blists - more mailing lists