Disallow re-use of the same label within a dts file
Jon Loeliger
jdl at jdl.com
Wed Feb 24 02:06:23 EST 2010
> Currently, nothing will stop you from re-using the same label string
> multiple times in a dts, e.g.:
> / {
> samelabel: prop1 = "foo";
> samelabel: prop2 = "bar";
> };
>
> or
> / {
> samelabel: prop1 = "foo";
> samelabel: subnode {
> };
> };
>
> When using node references by label, this could lead to confusing
> results (with no warning), and in -Oasm mode will result in output
> which the assembler will complain about (since it too will have
> duplicate labels).
>
> This patch, therefore, adds code to checks.c to give errors if you
> attempt to re-use the same label. It treats all labels (node,
> property, and value) as residing in the same namespace, since the
> assembler will treat them so for -Oasm mode.
>
> Testcases for the new code are also added.
>
> Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
Applied.
More information about the devicetree-discuss
mailing list