virtio_ring: remove unnecessary to_vvq call in poll_packed
PATCH 1/1 virtio_ring: remove unnecessary to_vvq call in poll_packed
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 <[email protected]>
--- drivers/virtio/virtio_ring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/virtio/virtio_ring.c +2 -3
@@ -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);
Signature · 1 line
2.27.0