Skip to content

Commit

Permalink
virtio: teach virtio_has_feature() about transport features
Browse files Browse the repository at this point in the history
Drivers don't add transport features to their table, so we
shouldn't check these with virtio_check_driver_offered_feature().

We could perhaps add an ->offered_feature() virtio_config_op,
but that perhaps that would be overkill for a consitency check
like this.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Mark McLoughlin authored and Rusty Russell committed Jun 12, 2009
1 parent a928928 commit ee006b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/virtio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
if (__builtin_constant_p(fbit))
BUILD_BUG_ON(fbit >= 32);

virtio_check_driver_offered_feature(vdev, fbit);
if (fbit < VIRTIO_TRANSPORT_F_START)
virtio_check_driver_offered_feature(vdev, fbit);

return test_bit(fbit, vdev->features);
}

Expand Down

0 comments on commit ee006b3

Please sign in to comment.