Re: [PATCH v4 03/10] software node: allow referencing firmware nodes
From: Andy Shevchenko
Date: Mon Nov 03 2025 - 08:51:04 EST
On Mon, Nov 03, 2025 at 11:36:36AM +0100, Bartosz Golaszewski wrote:
> On Mon, Nov 3, 2025 at 10:49 AM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Mon, Nov 03, 2025 at 10:35:23AM +0100, Bartosz Golaszewski wrote:
...
> > > +#define SOFTWARE_NODE_REF_SWNODE(_ref, ...) \
> > > + __SOFTWARE_NODE_REF(_ref, __VA_ARGS__)
> > > +
> > > +#define SOFTWARE_NODE_REF_FWNODE(_ref, ...) \
> > > + __SOFTWARE_NODE_REF(_ref, __VA_ARGS__)
> > > +
> > > +/* DEPRECATED, use SOFTWARE_NODE_REF_SWNODE() instead. */
> > > +#define SOFTWARE_NODE_REFERENCE(_ref, ...) \
> > > + SOFTWARE_NODE_REF_SWNODE(_ref, __VA_ARGS__)
> >
> > Now, useless.
>
> No, why? With these changes, SOFTWARE_NODE_REFERENCE()'s name is a bit
> misleading or incomplete, so I'm proposing to start replacing it with
> SOFTWARE_NODE_REF_SWNODE() which is compatible with the former but has
> a better name.
It's an unneeded churn. I don't see a confusion here. One may interpret
That it is a reference in a software node to another node.
...
> > > -#define PROPERTY_ENTRY_REF(_name_, _ref_, ...) \
> > > +#define __PROPERTY_ENTRY_REF(_type, _name, _ref, ...) \
> > > (struct property_entry) { \
> > > - .name = _name_, \
> > > + .name = _name, \
> > > .length = sizeof(struct software_node_ref_args), \
> > > .type = DEV_PROP_REF, \
> > > - { .pointer = &SOFTWARE_NODE_REFERENCE(_ref_, ##__VA_ARGS__), }, \
> > > + { .pointer = &_type(_ref, ##__VA_ARGS__), }, \
> > > }
> >
> > Do we need this now? I assume that _Generic() takes case of this.
> Ah, right, it should be done here as well.
Just it should work as is without changes, did I miss anything?
...
> > > +#define PROPERTY_ENTRY_REF_SWNODE(_name, _ref, ...) \
> > > + __PROPERTY_ENTRY_REF(SOFTWARE_NODE_REF_SWNODE, \
> > > + _name, _ref, __VA_ARGS__)
> > > +
> > > +#define PROPERTY_ENTRY_REF_FWNODE(_name, _ref, ...) \
> > > + __PROPERTY_ENTRY_REF(SOFTWARE_NODE_REF_FWNODE, \
> > > + _name, _ref, __VA_ARGS__)
> > > +
> > > +/* DEPRECATED, use PROPERTY_ENTRY_REF_SWNODE() instead. */
> > > +#define PROPERTY_ENTRY_REF(_name, _ref, ...) \
> > > + PROPERTY_ENTRY_REF_SWNODE(_name, _ref, __VA_ARGS__)
> >
> > Seems like useless churn.
>
> This is the same argument as with SOFTWARE_NODE_REF_SWNODE(). It's not
> clear from the name what PROPERTY_ENTRY_REF() is really referencing.
Same answer as above.
...
TL;DR: Let's leave renaming / splitting to another series. It doesn't sound
like a required thingy. Only what I see is unneeded churn.
--
With Best Regards,
Andy Shevchenko