diff options
author | Maximilian Brune <maximilian.brune@9elements.com> | 2024-06-13 20:58:26 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-08 08:08:40 +0000 |
commit | 1ce1b58b0153c1fc6f8cdc10b33fc0e906a42ea3 (patch) | |
tree | fadb397962823f2816b036717cba4280a204169e /src/commonlib/device_tree.c | |
parent | c6173d1fe4d0804d27a36117cc612a523f1fe480 (diff) |
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>
Diffstat (limited to 'src/commonlib/device_tree.c')
-rw-r--r-- | src/commonlib/device_tree.c | 8 |
1 files changed, 2 insertions, 6 deletions
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); } |