[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zsd_EctNZ80fuKMu@smile.fi.intel.com>
Date: Thu, 22 Aug 2024 21:10:25 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Petr Mladek <pmladek@...e.com>, Dave Jiang <dave.jiang@...el.com>,
Fan Ni <fan.ni@...sung.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Navneet Singh <navneet.singh@...el.com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Davidlohr Bueso <dave@...olabs.net>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
linux-btrfs@...r.kernel.org, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
nvdimm@...ts.linux.dev
Subject: Re: [PATCH v3 02/25] printk: Add print format (%par) for struct range
On Thu, Aug 22, 2024 at 12:53:32PM -0500, Ira Weiny wrote:
> Petr Mladek wrote:
> > On Fri 2024-08-16 09:44:10, Ira Weiny wrote:
...
> > > + %par [range 0x60000000-0x6fffffff] or
> >
> > It seems that it is always 64-bit. It prints:
> >
> > struct range {
> > u64 start;
> > u64 end;
> > };
>
> Indeed. Thanks I should not have just copied/pasted.
With that said, I'm not sure the %pa is a good placeholder for this ('a' stands
to "address" AFAIU). Perhaps this should go somewhere under %pr/%pR?
> > > + [range 0x0000000060000000-0x000000006fffffff]
> > > +
> > > +For printing struct range. A variation of printing a physical address is to
> > > +print the value of struct range which are often used to hold a physical address
> > > +range.
> > > +
> > > +Passed by reference.
...
> > Is this really needed? What about using "default_str_spec" instead?
>
> Because I got confused and was coping from resource_string().
>
> Deleted now...
>
> > > + .field_width = RANGE_PRINTK_SIZE,
>
> However, my testing indicates this needs to be.
>
> .field_width = 18, /* 2 (0x) + 2 * 8 (bytes) */
>
> ... to properly zero pad the value. Does that make sense?
Looking at this, moving under %pr/R should deduplicate the code, no?
I.o.w. better to use existing code for them to print struct range, no?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists