Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch



> On Jan 25, 2021, at 9:45 AM, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
> 
>    Date:        Mon, 25 Jan 2021 08:19:44 -0800
>    From:        Jason Thorpe <thorpej%me.com@localhost>
>    Message-ID:  <D53FD192-8F50-4609-A799-BA8C2D9016C7%me.com@localhost>
> 
>  | Using { 0 } makes an assumption about the first member of the
>  | structure which is not guaranteed to remain true.
> 
> That's right, but you could explicitly init a named field, most likely
> the one that is tested to determine that this is the sentinel, eg: from
> one of the recent updates ...
> 
> static const struct device_compatible_entry compat_data[] = {
>        { .compat = "pnpPNP,401" },
> -       { 0 }
> +       { }
> };
> 
> that could instead be changed to
> 	{ .compat = NULL }
> 
> (or something similar to that).

I noticed this because of a different local change in my tree that makes the first field another anonymous union.

Anyhow, I'll go ahead and define a standard sentinel macro that can be used for the common { .compat = XXX } case, and fire up sed to fix up the tree.

-- thorpej



Home | Main Index | Thread Index | Old Index