From: Petr Mladek <pmladek@suse.com>
To: Ira Weiny <ira.weiny@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Fan Ni <fan.ni@samsung.com>, Bagas Sanjaya <bagasdotme@gmail.com>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-cxl@vger.kernel.org
Subject: Re: [PATCH 2/3] printf: Add print format (%pra) for struct range
Date: Mon, 21 Oct 2024 16:30:47 +0200 [thread overview]
Message-ID: <ZxZll3-NZreHlRaI@pathway.suse.cz> (raw)
In-Reply-To: <6715c14e9bbf6_747d6294ed@iweiny-mobl.notmuch>
On Sun 2024-10-20 21:49:50, Ira Weiny wrote:
> Dan Williams wrote:
> > Ira Weiny wrote:
>
> [snip]
>
> > > diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
> > > index 14e093da3ccd..e1ebf0376154 100644
> > > --- a/Documentation/core-api/printk-formats.rst
> > > +++ b/Documentation/core-api/printk-formats.rst
> > > @@ -231,6 +231,19 @@ width of the CPU data path.
> > >
> > > Passed by reference.
> > >
> > > +Struct Range
> > > +------------
> > > +
> > > +::
> > > +
> > > + %pra [range 0x0000000060000000-0x000000006fffffff]
> > > + %pra [range 0x0000000060000000]
> > > +
> > > +For printing struct range. struct range holds an arbitrary range of u64
> > > +values. If start is equal to end only print the start value.
> >
> > I was going to say "why this special case that does not exist for the
> > %pr case?", but then checked the code and found it *does* do this for %pr.
> > So if you're going to document this special case for %pra might as well
> > update the documentation for %pr too.
> >
> > Alternatively, drop the new %pra documentation for this corner case as
> > accommodating the U64_MAX size range case is arguably a mistake in the
> > caller.
> >
> > Either way, just make it consistent.
>
> I've dropped the special case in the documentation.
I would actually prefer the opposite and update the %pr documentation.
The behavior might be surprising and people should beware of it,
for example when writing a parser for the output.
Best Regards,
Petr
next prev parent reply other threads:[~2024-10-21 14:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 19:46 [PATCH 0/3] printf: Add struct range print specifier Ira Weiny
2024-10-18 19:46 ` [PATCH 1/3] test printf: Add very basic struct resource tests Ira Weiny
2024-10-21 15:31 ` Petr Mladek
2024-10-18 19:46 ` [PATCH 2/3] printf: Add print format (%pra) for struct range Ira Weiny
2024-10-18 20:05 ` Dan Williams
2024-10-21 2:49 ` Ira Weiny
2024-10-21 14:30 ` Petr Mladek [this message]
2024-10-21 19:04 ` Ira Weiny
2024-10-21 6:57 ` Andy Shevchenko
2024-10-21 7:07 ` Andy Shevchenko
2024-10-18 19:46 ` [PATCH 3/3] cxl/cdat: Use %pra for dpa range outputs Ira Weiny
2024-10-22 1:40 ` Alison Schofield
2024-10-23 18:19 ` Ira Weiny
2024-10-24 2:14 ` Alison Schofield
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=ZxZll3-NZreHlRaI@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bagasdotme@gmail.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=fan.ni@samsung.com \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=vishal.l.verma@intel.com \
/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