[PATCH] virtio_ring: remove unnecessary to_vvq call in poll_packed
From: Deming Wang
Date: Wed Jun 22 2022 - 04:29:45 EST
It passes '_vq' to virtqueue_use_indirect(), which still calls
to_vvq to get 'vq', let's directly pass 'vq'. It can avoid
unnecessary call of to_vvq in virtqueue_poll_packed.
Signed-off-by: Deming Wang <wangdeming@xxxxxxxxxx>
---
drivers/virtio/virtio_ring.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 13a7348cedff..cb6323e0088b 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1522,9 +1522,8 @@ static unsigned int virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq)
VRING_PACKED_EVENT_F_WRAP_CTR);
}
-static bool virtqueue_poll_packed(struct virtqueue *_vq, u16 off_wrap)
+static bool virtqueue_poll_packed(struct vring_virtqueue *vq, u16 off_wrap)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
bool wrap_counter;
u16 used_idx;
@@ -2054,7 +2053,7 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned int last_used_idx)
return false;
virtio_mb(vq->weak_barriers);
- return vq->packed_ring ? virtqueue_poll_packed(_vq, last_used_idx) :
+ return vq->packed_ring ? virtqueue_poll_packed(vq, last_used_idx) :
virtqueue_poll_split(_vq, last_used_idx);
}
EXPORT_SYMBOL_GPL(virtqueue_poll);
--
2.27.0