diff options
author | Kumar Gala <kumar.gala@linaro.org> | 2021-02-10 13:39:12 -0600 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-02-15 17:17:36 +1100 |
commit | 88875268c05c9cf342d958a5c65973b0ee45888e (patch) | |
tree | 12a8eeb309bfca70ab47e11652e937115a07ef69 | |
parent | 9d2279e7e6ee937d7c47250720c92dd58fa1aa68 (diff) | |
download | device-tree-compiler-88875268c05c9cf342d958a5c65973b0ee45888e.tar.gz |
checks: Warn on node-name and property name being the same
Treat a node-name and property name at the same level of tree as
a warning
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Message-Id: <20210210193912.799544-1-kumar.gala@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | checks.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -331,6 +331,20 @@ static void check_node_name_format(struct check *c, struct dt_info *dti, } ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars); +static void check_node_name_vs_property_name(struct check *c, + struct dt_info *dti, + struct node *node) +{ + if (!node->parent) + return; + + if (get_property(node->parent, node->name)) { + FAIL(c, dti, node, "node name and property name conflict"); + } +} +WARNING(node_name_vs_property_name, check_node_name_vs_property_name, + NULL, &node_name_chars); + static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti, struct node *node) { @@ -1797,7 +1811,7 @@ WARNING(graph_endpoint, check_graph_endpoint, NULL, &graph_nodes); 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, + &name_is_string, &name_properties, &node_name_vs_property_name, &duplicate_label, |