Commit graph

5 commits

Author SHA1 Message Date
MacDue
f8bdb584f8 LibDeviceTree: Use unchecked_append() in path parsing
try_append() checks if the vector should increase capacity and if
so grows the vector. unchecked_append() verifies the vector already
has enough capacity, and will never grow the vector.
2023-02-24 23:56:37 +01:00
Linus Groh
69f0339bac Revert "LibDeviceTree: Propagate try_append() errors while parsing paths"
This reverts commit f064f5f36e.

As Andrew points out, this append is not actually fallible in practice,
since the loop is terminated once the vector size reaches its inline
capacity.

https://github.com/SerenityOS/serenity/pull/17606#discussion_r1117662246
2023-02-24 23:40:23 +01:00
MacDue
f064f5f36e LibDeviceTree: Propagate try_append() errors while parsing paths 2023-02-24 22:18:25 +01:00
Andrew Kaster
613cfb31b1 LibDeviceTree: Add a slow, allocation-free property fetch API
Using the walk_device_tree helper, we can walk the device tree from the
beginning looking for a specific property node. It's still missing the
ability to get property lists, string lists, and property-specific data.
2023-02-19 13:49:07 +01:00
Andrew Kaster
e9e279bb77 LibDeviceTree: Add walk_device_tree and use it to dump structured data
We can use this simple parser and its callbacks to implement more
complex parsing in later commits.
2023-02-19 13:49:07 +01:00