Attention is currently required from: Jakub Czapiga, Julius Werner, Martin L Roth.
Maximilian Brune has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/81081?usp=email )
Change subject: lib/device_tree: Add some FDT helper functions ......................................................................
Patch Set 18:
(2 comments)
File src/include/device_tree.h:
https://review.coreboot.org/c/coreboot/+/81081/comment/da16ab56_731cb288 : PS18, Line 203:
nit: Please add at least a line of documentation, particularly to clarify here what the return value […]
To all functions?
File src/lib/device_tree.c:
https://review.coreboot.org/c/coreboot/+/81081/comment/b15de1dc_ecd754b8 : PS18, Line 175: ""
I don't really understand the `""` here at the start, what does that represent? There shouldn't be a […]
I disagree. The root node is the same as any other node. Its name is an empty string. This function treats all paths as relative paths. Removing it would add quite some boilerplate code (in `fdt_find_node_by_path`) to skip the root node and returns its offset if the user requested "/". It would treat the root node special (even though it isn't).
Using
``` fdt_find_node(blob, root_node_offset, { NULL }, ... ``` will not work, because it would strcmp NULL. I have to put the NULL check after the strcmp in order to return the correct offset.