Re: [PATCH v1 1/2] device property: Get rid of __PROPERTY_ENTRY_ARRAY_EL*SIZE*()

From: Andy Shevchenko
Date: Fri Nov 04 2022 - 13:35:24 EST


On Fri, Nov 04, 2022 at 05:48:48PM +0200, Andy Shevchenko wrote:
> First of all, _ELEMENT_SIZE() repeats existing sizeof_field() macro.
> Second, usage of _ARRAY_ELSIZE_LEN() adds unnecessary indirection
> to the data layout. It's more understandable when the data structure
> is placed explicitly. That said, get rid of those macros by replacing
> them with the existing helper and explicit data structure layout.

...

> +(struct property_entry) { \
> + .name = _name_, \
> + .length = (_len_) * sizeof(struct software_node_ref_args), \
> + .type = DEV_PROP_##_Type_, \

> + .pointer = _val_, \

While waiting for the comments, I have noticed missed {} here. I haven't
checked if gcc 5.1 still requires that, but in any case that should be matter
of a separate patch (to drop {} for anonymous union members initialization).

That said, v2 will occur if no serious objection is provided.

> +}

--
With Best Regards,
Andy Shevchenko