lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6716a5bd3308_b74f729424@iweiny-mobl.notmuch>
Date: Mon, 21 Oct 2024 14:04:29 -0500
From: Ira Weiny <ira.weiny@...el.com>
To: Petr Mladek <pmladek@...e.com>, Ira Weiny <ira.weiny@...el.com>
CC: Dan Williams <dan.j.williams@...el.com>, Andrew Morton
	<akpm@...ux-foundation.org>, Steven Rostedt <rostedt@...dmis.org>, "Andy
 Shevchenko" <andriy.shevchenko@...ux.intel.com>, Rasmus Villemoes
	<linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>,
	Jonathan Corbet <corbet@....net>, Davidlohr Bueso <dave@...olabs.net>,
	Jonathan Cameron <jonathan.cameron@...wei.com>, Dave Jiang
	<dave.jiang@...el.com>, Alison Schofield <alison.schofield@...el.com>,
	"Vishal Verma" <vishal.l.verma@...el.com>, Fan Ni <fan.ni@...sung.com>, Bagas
 Sanjaya <bagasdotme@...il.com>, <linux-kernel@...r.kernel.org>,
	<linux-doc@...r.kernel.org>, <linux-cxl@...r.kernel.org>
Subject: Re: [PATCH 2/3] printf: Add print format (%pra) for struct range

Petr Mladek wrote:
> 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.

Works for me.  I added a patch to enhance %pr and left in the %pra doc.

Ira

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ