Skip to content

Commit

Permalink
virtio: fix BAD_RING, START_US and END_USE macros
Browse files Browse the repository at this point in the history
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: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Roel Kluin authored and Rusty Russell committed Mar 30, 2009
1 parent 0d34fb8 commit 3a35ce7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

#ifdef DEBUG
/* For development, we want to crash whenever the ring is screwed. */
#define BAD_RING(vq, fmt...) \
do { dev_err(&vq->vq.vdev->dev, fmt); BUG(); } while(0)
#define START_USE(vq) \
do { if ((vq)->in_use) panic("in_use = %i\n", (vq)->in_use); (vq)->in_use = __LINE__; mb(); } while(0)
#define END_USE(vq) \
do { BUG_ON(!(vq)->in_use); (vq)->in_use = 0; mb(); } while(0)
#define BAD_RING(_vq, fmt...) \
do { dev_err(&_vq->vq.vdev->dev, fmt); BUG(); } while(0)
#define START_USE(_vq) \
do { if ((_vq)->in_use) panic("in_use = %i\n", (_vq)->in_use); (_vq)->in_use = __LINE__; mb(); } while(0)
#define END_USE(_vq) \
do { BUG_ON(!(_vq)->in_use); (_vq)->in_use = 0; mb(); } while(0)
#else
#define BAD_RING(vq, fmt...) \
do { dev_err(&vq->vq.vdev->dev, fmt); (vq)->broken = true; } while(0)
#define BAD_RING(_vq, fmt...) \
do { dev_err(&_vq->vq.vdev->dev, fmt); (_vq)->broken = true; } while(0)
#define START_USE(vq)
#define END_USE(vq)
#endif
Expand Down

0 comments on commit 3a35ce7

Please sign in to comment.