Re: [PATCH v4 02/28] printk: Add print format (%pra) for struct range

From: Andy Shevchenko
Date: Wed Oct 09 2024 - 10:43:36 EST


On Wed, Oct 09, 2024 at 01:27:37PM +0100, Jonathan Cameron wrote:
> On Tue, 8 Oct 2024 19:56:20 +0300
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Mon, Oct 07, 2024 at 06:16:08PM -0500, Ira Weiny wrote:

...

> > > +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()

I understand your point, but since there are many similarities to struct
resource, I would stick with naming convention in ioport.h.

> INIT_RANGE() maybe?

--
With Best Regards,
Andy Shevchenko