Skip to content

zephyr: work: Allow struct to have a additional fields #105

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

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Conversation

d3zd3z
Copy link
Collaborator

@d3zd3z d3zd3z commented Jun 4, 2025

Structs in the C world assume zero initialization, and therefore adding fields is not considered an API change. Support this for an upcoming API change in the work queue config, by deriving default for these structs, and using this zero-init as a default. This should support fields being added to this struct. The rust code will zero init the unknown fields, which will have the same behavior as the C code.

This should allow zephyr#88345 to be merged, as well as allow the Rust code to work both before and after this change.

@d3zd3z d3zd3z requested review from teburd and cfriedt June 4, 2025 13:58
Structs in the C world assume zero initialization, and therefore adding
fields is not considered an API change.  Support this for an upcoming
API change in the work queue config, by deriving default for these
structs, and using this zero-init as a default.  This should support
fields being added to this struct. The rust code will zero init the
unknown fields, which will have the same behavior as the C code.

Signed-off-by: David Brown <[email protected]>
@d3zd3z d3zd3z merged commit dd73abc into main Jun 4, 2025
4 checks passed
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.

3 participants