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>
This commit is contained in:
Maximilian Brune 2024-06-13 20:58:26 +02:00 committed by Felix Held
parent c6173d1fe4
commit 1ce1b58b01

View File

@ -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);
}