Skip to content
Snippets Groups Projects
Commit cfdbb4ed authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Michael S. Tsirkin
Browse files

vhost: silence an unused-variable warning


On some architectures, the MMU can be disabled, leading to access_ok()
becoming an empty macro that does not evaluate its size argument,
which in turn produces an unused-variable warning:

drivers/vhost/vhost.c:1191:9: error: unused variable 's' [-Werror,-Wunused-variable]
        size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;

Mark the variable as __maybe_unused to shut up that warning.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent ab7a2375
No related branches found
No related tags found
No related merge requests found
...@@ -1188,7 +1188,7 @@ static bool vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, ...@@ -1188,7 +1188,7 @@ static bool vq_access_ok(struct vhost_virtqueue *vq, unsigned int num,
struct vring_used __user *used) struct vring_used __user *used)
{ {
size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; size_t s __maybe_unused = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;
return access_ok(desc, num * sizeof *desc) && return access_ok(desc, num * sizeof *desc) &&
access_ok(avail, access_ok(avail,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment