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

Use priv data for name-service callback #567

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Conversation

glneo
Copy link
Contributor

@glneo glneo commented Mar 15, 2024

No description provided.

In rpmsg_virtio_ns_callback() we directly case from rpmsg_device* to
rpmsg_virtio_device*. This only works if rdev is the first member.
Use metal_container_of() to remove this assumption on struct order.

Signed-off-by: Andrew Davis <[email protected]>
@glneo glneo force-pushed the struct-order-fix branch from c3ade57 to 2e543a3 Compare March 15, 2024 19:42
glneo added 2 commits March 15, 2024 15:18
There is a private data member in the endpoint struct that is passed into
the callback, but there is no way to populate it. Add this to the
endpoint register function.

Signed-off-by: Andrew Davis <[email protected]>
The callback allows us to add private data. Use that to store our
rpmsg_device instance instead of extracting it from the endpoint
struct. The contents of that struct are internal to the RPMsg layer.

Signed-off-by: Andrew Davis <[email protected]>
@glneo glneo force-pushed the struct-order-fix branch from 2e543a3 to 87651c2 Compare March 15, 2024 20:18
@arnopo arnopo requested review from edmooring, arnopo and tnmysh March 22, 2024 08:45
Copy link
Contributor

@edmooring edmooring left a comment

Choose a reason for hiding this comment

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

Otherwise, looks good to go.

lib/rpmsg/rpmsg.c Show resolved Hide resolved
@arnopo arnopo added this to the Release V2024.04 milestone Apr 9, 2024
@arnopo arnopo merged commit c245b3b into OpenAMP:main Apr 9, 2024
3 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.

4 participants