Commit 3a35ce7d authored by Roel Kluin's avatar Roel Kluin Committed by Rusty Russell

virtio: fix BAD_RING, START_US and END_USE macros

Impact: cleanup

fix BAD_RING, START_US and END_USE macros

When these macros aren't called with a variable named vq as first
argument, this would result in a build failure.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 0d34fb8e
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
#ifdef DEBUG #ifdef DEBUG
/* For development, we want to crash whenever the ring is screwed. */ /* For development, we want to crash whenever the ring is screwed. */
#define BAD_RING(vq, fmt...) \ #define BAD_RING(_vq, fmt...) \
do { dev_err(&vq->vq.vdev->dev, fmt); BUG(); } while(0) do { dev_err(&_vq->vq.vdev->dev, fmt); BUG(); } while(0)
#define START_USE(vq) \ #define START_USE(_vq) \
do { if ((vq)->in_use) panic("in_use = %i\n", (vq)->in_use); (vq)->in_use = __LINE__; mb(); } while(0) do { if ((_vq)->in_use) panic("in_use = %i\n", (_vq)->in_use); (_vq)->in_use = __LINE__; mb(); } while(0)
#define END_USE(vq) \ #define END_USE(_vq) \
do { BUG_ON(!(vq)->in_use); (vq)->in_use = 0; mb(); } while(0) do { BUG_ON(!(_vq)->in_use); (_vq)->in_use = 0; mb(); } while(0)
#else #else
#define BAD_RING(vq, fmt...) \ #define BAD_RING(_vq, fmt...) \
do { dev_err(&vq->vq.vdev->dev, fmt); (vq)->broken = true; } while(0) do { dev_err(&_vq->vq.vdev->dev, fmt); (_vq)->broken = true; } while(0)
#define START_USE(vq) #define START_USE(vq)
#define END_USE(vq) #define END_USE(vq)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment