[RFC PATCH 2/4] virtio_ring: switch to use BAD_RING()

From: Jason Wang
Date: Thu Dec 22 2022 - 01:05:53 EST


Switch to reuse BAD_RING() to allow common logic to be implemented in
BAD_RING().

Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
---
drivers/virtio/virtio_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 2e7689bb933b..90c2034a77f3 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -2237,7 +2237,7 @@ bool virtqueue_notify(struct virtqueue *_vq)

/* Prod other side to tell it about changes. */
if (!vq->notify(_vq)) {
- vq->broken = true;
+ BAD_RING(vq, "vq %d is broken\n", vq->vq.index);
return false;
}
return true;
--
2.25.1