Skip to content

node: add iter_cell_size and iter_prop_encoded helpers#31

Open
rmsyn wants to merge 4 commits intorepnop:masterfrom
rmsyn:node/prop-usize-list
Open

node: add iter_cell_size and iter_prop_encoded helpers#31
rmsyn wants to merge 4 commits intorepnop:masterfrom
rmsyn:node/prop-usize-list

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

@rmsyn rmsyn force-pushed the node/prop-usize-list branch from 66686aa to 3da12f1 Compare May 2, 2024 21:35
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 rmsyn force-pushed the node/prop-usize-list branch from 3da12f1 to 49ba36c Compare May 2, 2024 22:28
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 rmsyn force-pushed the node/prop-usize-list branch from 49ba36c to c7f7bc9 Compare May 2, 2024 22:31
@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.

2 participants