From: "Luca Weiss" <luca.weiss@fairphone.com>
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: "Petr Mladek" <pmladek@suse.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
"Jonathan Corbet" <corbet@lwn.net>,
<~postmarketos/upstreaming@lists.sr.ht>,
<phone-devel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] docs: printk-formats: Clarify %*pb format parameters
Date: Mon, 22 May 2023 08:41:51 +0200 [thread overview]
Message-ID: <CSSLOC8WDIPE.1WO9BXZQA7A12@otso> (raw)
In-Reply-To: <ZGT+lJasWhZ0TPRi@smile.fi.intel.com>
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
next prev parent reply other threads:[~2023-05-22 6:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 6:52 [PATCH] docs: printk-formats: Clarify %*pb format parameters Luca Weiss
2023-05-17 16:19 ` Andy Shevchenko
2023-05-22 6:41 ` Luca Weiss [this message]
2023-05-22 15:08 ` [PATCH] vsprintf/doc: Document format flags including field width and precision Petr Mladek
2023-05-22 21:04 ` Rasmus Villemoes
2023-05-24 8:08 ` John Ogness
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CSSLOC8WDIPE.1WO9BXZQA7A12@otso \
--to=luca.weiss@fairphone.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=phone-devel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).