Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: add iter_cell_size and iter_prop_encoded helpers #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rmsyn
Copy link
Contributor

@rmsyn rmsyn commented Apr 24, 2024

Adds a NodeProperty::as_usize_list helper function to parse the property value as a usize list.

Copy link
Owner

@repnop repnop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some light changes and considerations

src/node.rs Outdated Show resolved Hide resolved
src/node.rs Outdated Show resolved Hide resolved
rmsyn added 2 commits May 2, 2024 21:37
Adds a `NodeProperty::as_usize_list` helper function to parse the
property value as a `usize` list.
Adds the `CellSize` enum type to represent valid property value cell
size variants.
rmsyn added 2 commits May 2, 2024 22:31
Converts the `CellSizes` type to use the new `CellSize` type instead of
`usize`.
Adds a helper function `FdtNode::iter_prop_encoded` to parse a property
as a `prop-encoded-array`.
@rmsyn
Copy link
Contributor Author

rmsyn commented May 3, 2024

@repnop I added some changes to address the points you brought up.

I removed the Option wrapper from the return type. Any failure to produce iter items will now just result in an empty iterator.

I also added the iter_prop_encoded helper to handle prop-encoded-array node properties, i.e. <address-cell(s) size-cell(s)>.

@rmsyn rmsyn changed the title node: add as_usize_list helper node: add iter_cell_size and iter_prop_encoded helpers May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants