checks: Remove check for graph child addresses
PATCH v3 1/1 checks: Remove check for graph child addresses
The dtc graph_child_address check can't distinguish between bindings where there can only be a single endpoint, and cases where there can be multiple endpoints.
In cases where the bindings allow for multiple endpoints but only one is described false warnings about unnecessary #address-cells/#size-cells can be generated, but only if the endpoint described have an address of 0 (A), for single endpoints with a non-zero address (B) no warnings are generated.
A)
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
#address-cells = <1>;
#size-cells = <0>;
sourceA: endpoint@0 {
reg = <0>
};
};
};B)
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
#address-cells = <1>;
#size-cells = <0>;
sourceB: endpoint@1 {
reg = <1>
};
};
};Remove the check as it is somewhat redundant now that we can use schemas to validate the full node.
---
Changes since v3
- Update test suite in tests/run_tests.sh.
- Add Rb from Rob.
Changes since v2
- Rebase after 6.17-rc1 merge window closed.
--- checks.c | 27 +-------------------------- tests/run_tests.sh | 2 -- 2 files changed, 1 insertion(+), 28 deletions(-)
checks.c +1 -26
@@ -1894,31 +1894,6 @@ static void check_graph_endpoint(struct check *c, struct dt_info *dti, }WARNING (graph_endpoint, check_graph_endpoint,NULL , &graph_nodes); -static void check_graph_child_address (struct check *c,struct dt_info *dti, -struct node *node) -{ -int cnt =0 ; -struct node *child; - -if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus) -return ; - -for_each_child (node, child) { -struct property *prop =get_property (child,"reg" ); - -/* No error if we have any non-zero unit address */ -if (prop &&propval_cell (prop) !=0 ) -return ; - - cnt++; - } - -if (cnt ==1 && node->addr_cells !=-1 ) -FAIL (c, dti, node,"graph node has single child node '%s', #address-cells/#size-cells are not necessary" , - node->children->name); -} -WARNING (graph_child_address, check_graph_child_address,NULL , &graph_nodes, &graph_port, &graph_endpoint); -static struct check *check_table[] = { &duplicate_node_names, &duplicate_property_names, &node_name_chars, &node_name_format, &property_name_chars,
@@ -2005,7 +1980,7 @@ static struct check *check_table[] = { &alias_paths, - &graph_nodes, &graph_child_address, &graph_port, &graph_endpoint, + &graph_nodes, &graph_port, &graph_endpoint, &always_fail, };
tests/run_tests.sh +0 -2
@@ -749,7 +749,6 @@ dtc_tests () { check_tests "$SRCDIR/bad-phandle-cells.dts" interrupts_extended_property check_tests "$SRCDIR/bad-gpio.dts" gpios_property check_tests "$SRCDIR/good-gpio.dts" -n gpios_property - check_tests "$SRCDIR/bad-graph.dts" graph_child_address check_tests "$SRCDIR/bad-graph.dts" graph_port check_tests "$SRCDIR/bad-graph.dts" graph_endpoint check_tests "$SRCDIR/bad-graph-root1.dts" graph_nodes
@@ -758,7 +757,6 @@ dtc_tests () { check_tests "$SRCDIR/bad-graph-root4.dts" graph_nodes check_tests "$SRCDIR/bad-graph-reg-cells.dts" graph_endpoint check_tests "$SRCDIR/bad-graph-reg-cells.dts" graph_port - check_tests "$SRCDIR/bad-graph-child-address.dts" graph_child_address run_sh_test "$SRCDIR/dtc-checkfails.sh" deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/bad-gpio.dts" run_sh_test "$SRCDIR/dtc-checkfails.sh" -n deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/good-gpio.dts" check_tests "$SRCDIR/bad-interrupt-cells.dts" interrupts_property
Signature · 1 line
2.50.1
David Gibson
AppliedQuoted 40 lines · Niklas Söderlund
The dtc
graph_child_addresscheck can't distinguish between bindings where there can only be a single endpoint, and cases where there can be multiple endpoints.In cases where the bindings allow for multiple endpoints but only one is described false warnings about unnecessary #address-cells/#size-cells can be generated, but only if the endpoint described have an address of 0 (A), for single endpoints with a non-zero address (B) no warnings are generated.
A)
ports { #address-cells = <1>; #size-cells = <0>; port@0 { #address-cells = <1>; #size-cells = <0>; sourceA: endpoint@0 { reg = <0> }; }; };B)
ports { #address-cells = <1>; #size-cells = <0>; port@0 { #address-cells = <1>; #size-cells = <0>; sourceB: endpoint@1 { reg = <1> }; }; };
Quoted 5 lines
Remove the check as it is somewhat redundant now that we can use schemas to validate the full node.
Signed-off-by Niklas Söderlund <[email protected]>Reviewed-by Rob Herring (Arm) <[email protected]>
Applied, thanks.
Signature · 4 lines
David Gibson (he or they) | 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