mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
virtio_ring: switch to use vring_virtqueue for detach_unused_buf variants
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Acked-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20251230064649.55597-12-jasowang@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
7e81017673
commit
f2ad9d6b4e
@@ -954,9 +954,8 @@ static bool virtqueue_enable_cb_delayed_split(struct vring_virtqueue *vq)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void *virtqueue_detach_unused_buf_split(struct virtqueue *_vq)
|
||||
static void *virtqueue_detach_unused_buf_split(struct vring_virtqueue *vq)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
unsigned int i;
|
||||
void *buf;
|
||||
|
||||
@@ -969,7 +968,7 @@ static void *virtqueue_detach_unused_buf_split(struct virtqueue *_vq)
|
||||
buf = vq->split.desc_state[i].data;
|
||||
detach_buf_split(vq, i, NULL);
|
||||
vq->split.avail_idx_shadow--;
|
||||
vq->split.vring.avail->idx = cpu_to_virtio16(_vq->vdev,
|
||||
vq->split.vring.avail->idx = cpu_to_virtio16(vq->vq.vdev,
|
||||
vq->split.avail_idx_shadow);
|
||||
END_USE(vq);
|
||||
return buf;
|
||||
@@ -1891,9 +1890,8 @@ static bool virtqueue_enable_cb_delayed_packed(struct vring_virtqueue *vq)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq)
|
||||
static void *virtqueue_detach_unused_buf_packed(struct vring_virtqueue *vq)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
unsigned int i;
|
||||
void *buf;
|
||||
|
||||
@@ -2645,8 +2643,8 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
|
||||
return vq->packed_ring ? virtqueue_detach_unused_buf_packed(_vq) :
|
||||
virtqueue_detach_unused_buf_split(_vq);
|
||||
return vq->packed_ring ? virtqueue_detach_unused_buf_packed(vq) :
|
||||
virtqueue_detach_unused_buf_split(vq);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user