-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Add and use VIRTIO_ROLE_IS_{DRIVER,DEVICE}() macros
There is a common pattern of checking the virtio role while also checking that this role is supported in this build, which can help optimize away unusable code. Add a couple macros for this. This has two main benefits, first being shorter and easier to read if statements, and also makes it easier to not forget to always do both checks. Use these everywhere except rpmsg_virtio.c which needs one more refactor before we can switch it over. Signed-off-by: Andrew Davis <[email protected]>
- Loading branch information
Showing
4 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters