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

Finish converting rpmsg_virtio to use VIRTIO_ROLE_IS_{DRIVER,DEVICE}() #581

Merged
merged 3 commits into from
May 20, 2024

Conversation

glneo
Copy link
Contributor

@glneo glneo commented Apr 23, 2024

Follow up series finishing #560

glneo added 3 commits April 23, 2024 09:51
The `role` member of `struct virtio_device` stores either the value
VIRTIO_DEV_DRIVER or VIRTIO_DEV_DEVICE. This means the function
rpmsg_virtio_get_role() will also return one of these values.
The values RPMSG_HOST and RPMSG_REMOTE are defined to be the same,
but there is no need for this redefinition. Update the return
values in the comment docs.

While here, remove the same from rpmsg_virtio_set_wait_cb() which
does not return anything, this looks to be a copy/paste error.

Signed-off-by: Andrew Davis <[email protected]>
For all cases when the role is checked in rpmsg_virtio, what is being
checked is the role of the underlying virtio layer. As such, we should
be matching against the role definitions for the virtio layer
(VIRTIO_DEV_DEVICE and VIRTIO_DEV_DRIVER). Fix this here.

While the underlying virtio layer may be asymmetric, the RPMSG layer
generally is symmetrical. There is no need to define a HOST or REMOTE
role specific to the RPMSG layer. And as there are now no more internal
users of these definitions, deprecate them here.

Signed-off-by: Andrew Davis <[email protected]>
Now that we match role to VIRTIO_DEV_{DRIVER,DEVICE} we can replace
all these double check if statements with the role checking macro
already used in all other files.

Signed-off-by: Andrew Davis <[email protected]>
@arnopo arnopo requested review from edmooring, arnopo and tnmysh April 24, 2024 12:33
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

LGTM

@arnopo arnopo merged commit fdef576 into OpenAMP:main May 20, 2024
3 checks passed
@arnopo arnopo added this to the Release V2024.05 milestone May 20, 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.

3 participants