diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-05-11 18:11:44 +0100 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-12 22:16:38 +0930 |
commit | ee006b353f1ca8c9a8470b72b462beb011d62e32 (patch) | |
tree | 205cb0ba2a4e08377effe7a2d10432047e82c1c9 | |
parent | a92892825a122a74ddad1d408fa27132e28b05ae (diff) | |
download | linux-ee006b353f1ca8c9a8470b72b462beb011d62e32.tar.gz linux-ee006b353f1ca8c9a8470b72b462beb011d62e32.tar.bz2 linux-ee006b353f1ca8c9a8470b72b462beb011d62e32.zip |
virtio: teach virtio_has_feature() about transport features
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>
-rw-r--r-- | include/linux/virtio_config.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 4cd290c06a88..99f514575f6a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -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); } |