aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
-rw-r--r--drivers/virtio/virtio_ring.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 00ec6b3f96b2..096b857e7b75 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -54,8 +54,7 @@
54#define END_USE(vq) 54#define END_USE(vq)
55#endif 55#endif
56 56
57struct vring_virtqueue 57struct vring_virtqueue {
58{
59 struct virtqueue vq; 58 struct virtqueue vq;
60 59
61 /* Actual memory layout for this queue */ 60 /* Actual memory layout for this queue */
@@ -245,14 +244,14 @@ static inline int virtqueue_add(struct virtqueue *_vq,
245 vq->vring.avail->idx = cpu_to_virtio16(_vq->vdev, virtio16_to_cpu(_vq->vdev, vq->vring.avail->idx) + 1); 244 vq->vring.avail->idx = cpu_to_virtio16(_vq->vdev, virtio16_to_cpu(_vq->vdev, vq->vring.avail->idx) + 1);
246 vq->num_added++; 245 vq->num_added++;
247 246
247 pr_debug("Added buffer head %i to %p\n", head, vq);
248 END_USE(vq);
249
248 /* This is very unlikely, but theoretically possible. Kick 250 /* This is very unlikely, but theoretically possible. Kick
249 * just in case. */ 251 * just in case. */
250 if (unlikely(vq->num_added == (1 << 16) - 1)) 252 if (unlikely(vq->num_added == (1 << 16) - 1))
251 virtqueue_kick(_vq); 253 virtqueue_kick(_vq);
252 254
253 pr_debug("Added buffer head %i to %p\n", head, vq);
254 END_USE(vq);
255
256 return 0; 255 return 0;
257} 256}
258 257