From 1ce1b58b0153c1fc6f8cdc10b33fc0e906a42ea3 Mon Sep 17 00:00:00 2001 From: Maximilian Brune Date: Thu, 13 Jun 2024 20:58:26 +0200 Subject: 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 Change-Id: Ic1111e8acb72ea1e9159da0d8386f40cbbdbc63f Reviewed-on: https://review.coreboot.org/c/coreboot/+/83085 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/commonlib/device_tree.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/commonlib/device_tree.c b/src/commonlib/device_tree.c index a8a64ecbbe..cb7a596bc5 100644 --- a/src/commonlib/device_tree.c +++ b/src/commonlib/device_tree.c @@ -414,18 +414,14 @@ size_t fdt_find_subnodes_by_prefix(const void *blob, u32 node_offset, const char // 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); } -- cgit v1.2.3