[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241009132737.000046ca@Huawei.com>
Date: Wed, 9 Oct 2024 13:27:37 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: Ira Weiny <ira.weiny@...el.com>, Dave Jiang <dave.jiang@...el.com>, "Fan
Ni" <fan.ni@...sung.com>, Navneet Singh <navneet.singh@...el.com>, "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-doc@...r.kernel.org>,
<nvdimm@...ts.linux.dev>, <linux-kernel@...r.kernel.org>, Petr Mladek
<pmladek@...e.com>, Steven Rostedt <rostedt@...dmis.org>, Rasmus Villemoes
<linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [PATCH v4 02/28] printk: Add print format (%pra) for struct
range
On Tue, 8 Oct 2024 19:56:20 +0300
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> On Mon, Oct 07, 2024 at 06:16:08PM -0500, Ira Weiny wrote:
> > The use of struct range in the CXL subsystem is growing. In particular,
> > the addition of Dynamic Capacity devices uses struct range in a number
> > of places which are reported in debug and error messages.
> >
> > To wit requiring the printing of the start/end fields in each print
> > became cumbersome. Dan Williams mentions in [1] that it might be time
> > to have a print specifier for struct range similar to struct resource
> >
> > A few alternatives were considered including '%par', '%r', and '%pn'.
> > %pra follows that struct range is similar to struct resource (%p[rR])
> > but need to be different. Based on discussions with Petr and Andy
> > '%pra' was chosen.[2]
> >
> > Andy also suggested to keep the range prints similar to struct resource
> > though combined code. Add hex_range() to handle printing for both
> > pointer types.
>
> ...
>
> > +static void __init
> > +struct_range(void)
> > +{
> > + struct range test_range = {
> > + .start = 0xc0ffee00ba5eba11,
> > + .end = 0xc0ffee00ba5eba11,
> > + };
>
> A side note, can we add something like
>
> #define DEFINE_RANGE(start, end) \
> (struct range) { \
> .start = (start), \
> .end = (end), \
> }
>
> in range.h and use here and in the similar cases?
DEFINE_XXXX at least sometimes is used in cases that create the
variable as well. E.g. DEFINE_MUTEX()
INIT_RANGE() maybe?
Powered by blists - more mailing lists