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

lib: virtio: Fix VIRTIO ROLE_XXXX macro definitions #634

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

arnopo
Copy link
Collaborator

@arnopo arnopo commented Jan 10, 2025

Add parentheses around the "vdev" parameter to avoid side effects.

This fixes a build error when using the macro in the following way:
if (VIRTIO_ROLE_IS_DEVICE(&my_context->vdev))

The error encountered:
openamp/open-amp/lib/include/openamp/virtio.h:89:49: error: invalid type argument of ‘->’ (have ‘struct virtio_device’)
89 | (VIRTIO_ENABLED(VIRTIO_DRIVER_SUPPORT) && (vdev->role) == VIRTIO_DEV_DRIVER)

Add parentheses around the "vdev" parameter to avoid side effects.

This fixes a build error when using the macro in the following way:
  if (VIRTIO_ROLE_IS_DEVICE(&my_context->vdev))

The error encountered:
openamp/open-amp/lib/include/openamp/virtio.h:89:49: error: invalid type argument of ‘->’ (have ‘struct virtio_device’)
   89 |  (VIRTIO_ENABLED(VIRTIO_DRIVER_SUPPORT) && (vdev->role) == VIRTIO_DEV_DRIVER)

Signed-off-by: Arnaud Pouliquen <[email protected]>
@arnopo arnopo added this to the Release V2025.04 milestone Jan 10, 2025
@arnopo arnopo requested review from edmooring and tnmysh January 10, 2025 08:22
@arnopo
Copy link
Collaborator Author

arnopo commented Jan 10, 2025

To ignore checkpatch failure: exceeding 80 characters to detail the build error traces in commit message is acceptable.

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.

Looks good to go.

@arnopo arnopo merged commit 3122cec into OpenAMP:main Jan 13, 2025
4 of 5 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