Page MenuHomeFreeBSD

virtio: use bool for boolean functions
ClosedPublic

Authored by freebsd_igalic.co on Sep 13 2023, 10:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 9, 6:35 PM
Unknown Object (File)
Sun, Feb 9, 5:38 PM
Unknown Object (File)
Fri, Feb 7, 11:34 AM
Unknown Object (File)
Tue, Feb 4, 7:03 AM
Unknown Object (File)
Tue, Feb 4, 5:53 AM
Unknown Object (File)
Tue, Jan 28, 2:05 PM
Unknown Object (File)
Mon, Jan 27, 12:50 PM
Unknown Object (File)
Sun, Jan 26, 6:03 PM
Subscribers

Details

Summary

these static functions:

  • vq_ring_use_indirect

and these public functions:

  • virtio_bus_is_modern
  • virtio_with_feature
  • virtqueue_empty
  • virtqueue_full

exclusively return a boolean value.
Change their return values to bool.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cognet added inline comments.
sys/dev/virtio/pci/virtio_pci_legacy.c
91

Hmm those int arguments, disappearing from the virtqueues method, should probably not be removed in that commit :)

sys/dev/virtio/pci/virtio_pci_modern.c
116

ditto

sys/dev/virtio/pci/virtio_pci_legacy.c
91

thanks for catching that.
looks like a botched rebase

thanks to @cognet for helping catch this rebase fuckup.

This revision is now accepted and ready to land.Sep 15 2023, 3:45 AM
This revision was automatically updated to reflect the committed changes.

I reckon this commit can easily be MFC'd without causing too much breakage