From: Michael S. Tsirkin Date: Fri, 20 Apr 2018 17:22:40 +0000 (+0300) Subject: virtio: add ability to iterate over vqs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ae93ff136a00eccc0027d9a01c95680a9e8d756;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git virtio: add ability to iterate over vqs commit 24a7e4d20783c0514850f24a5c41ede46ab058f0 upstream. For cleanup it's helpful to be able to simply scan all vqs and discard all data. Add an iterator to do that. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 988c7355bc22..fa1b5da2804e 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -157,6 +157,9 @@ int virtio_device_freeze(struct virtio_device *dev); int virtio_device_restore(struct virtio_device *dev); #endif +#define virtio_device_for_each_vq(vdev, vq) \ + list_for_each_entry(vq, &vdev->vqs, list) + /** * virtio_driver - operations for a virtio I/O driver * @driver: underlying device driver (populate name and owner).