Re: [PATCH 1/2] Warn on node name unit-address presence/absence mismatch

David Gibson
2016-02-19T05:02:29Z

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

On Thu, Feb 11, 2016 at 02:46:58PM -0600, Rob Herring wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> ePAPR 1.1 section 2.2.1.1 "Node Name Requirements" specifies that any
> node that has a reg property must include a unit address in its name
> with value matching the first entry in its reg property. Conversely, if
> a node does not have a reg property, the node name must not include a
> unit address. Also allow ranges property as it is deemed valid, but ePAPR
> is not clear about it.
>
> Implement a check for this. The code doesn't validate the format of the
> unit address; ePAPR implies this may vary from (containing bus) binding
> to binding, so doing so would be much more complex.
>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> [robh: also allow non-empty ranges]
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

I've applied this to master.

[snip]
> @@ -654,8 +678,8 @@ TREE_WARNING(obsolete_chosen_interrupt_controller, NULL);
>
> static struct check *check_table[] = {
> &duplicate_node_names, &duplicate_property_names,
> - &node_name_chars, &node_name_format, &property_name_chars,
> - &name_is_string, &name_properties,
> + &node_name_chars, &node_name_format, &unit_address_vs_reg,
> + &property_name_chars, &name_is_string, &name_properties,
>

However, I've moved the new test around in check_table. It's original
test placed it next to very basic structural tests, further down with
more semantic tests makes more sense.

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]