Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83085?usp=email )
Change subject: commonlib/device_tree.c: Remove incorrect warning ......................................................................
commonlib/device_tree.c: Remove incorrect warning
Currently a warning is printed even if the maximum amount of nodes is not exceeded.
Remove the warning, since in most cases the maximum amount of nodes for a given prefix is usually well known. For example the /cpu nodes always have a maximum of CONFIG_MAX_CPUS. One may also just want to read the first X amount of nodes matching a given prefix.
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: Ic1111e8acb72ea1e9159da0d8386f40cbbdbc63f Reviewed-on: https://review.coreboot.org/c/coreboot/+/83085 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/commonlib/device_tree.c 1 file changed, 2 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/commonlib/device_tree.c b/src/commonlib/device_tree.c index a8a64ec..cb7a596 100644 --- a/src/commonlib/device_tree.c +++ b/src/commonlib/device_tree.c @@ -414,18 +414,14 @@ // walk all children nodes of offset while ((size = fdt_next_node_name(blob, offset, &node_name))) {
- if (count_results >= results_len) { - printk(BIOS_WARNING, - "%s: results_len (%zd) smaller than count_results (%zd)\n", - __func__, results_len, count_results); + // check if there is space left in the results array + if (count_results >= results_len) break; - }
if (!strncmp(prefix, node_name, prefix_len)) { // we found a node that matches the prefix results[count_results++] = offset; } - // node does not match the prefix. skip current node offset += fdt_skip_node(blob, offset); }