[U-Boot] [PATCH v3] drivers: usb: fsl-dt-fixup: Fix the dt for multiple USB nodes in single traversal of device tree
Brüns, Stefan
Stefan.Bruens at rwth-aachen.de
Fri Oct 28 16:58:39 CEST 2016
On Freitag, 28. Oktober 2016 01:52:26 CEST Marek Vasut wrote:
[...]
> > +
> > +enum fdt_fsl_usb_erratum {
> > + A006261,
> > + A007075,
> > + A007792,
> > + A005697,
> > + A008751,
> > + FSL_USB_ERRATUM_END
>
> The compiler can assign completely arbitrary numbers to the enum
> elements. Moreover, you don't need this "terminating entry" anyway, see
> below.
Not true. According to
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
6.7.2.2 Enumeration specifiers
...
An enumerator with = defines its enumeration constant as the value of the
constant expression. If the first enumerator has no =, the value of its
enumeration constant is 0. Each subsequent enumerator with no = defines its
enumeration constant as the value of the constant expression obtained by
adding 1 to the value of the previous enumeration constant.
Kind regards,
Stefan
More information about the U-Boot
mailing list