aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRusty Russell2012-10-16 08:26:16 -0500
committerRusty Russell2012-12-17 22:50:38 -0600
commitde929b04450f2ec984c2febb1249d0e0f993d0a2 (patch)
tree8a0d4c995fc7b978f04681e538648214d4211b53 /tools
parent4614e51cccca0eb42ff7b1b6383e2d07db42edc8 (diff)
downloadkernel-omap-de929b04450f2ec984c2febb1249d0e0f993d0a2.tar.gz
kernel-omap-de929b04450f2ec984c2febb1249d0e0f993d0a2.tar.xz
kernel-omap-de929b04450f2ec984c2febb1249d0e0f993d0a2.zip
virtio: tools: make it clear that virtqueue_add_buf() no longer returns > 0
We simplified virtqueue_add_buf(), make it clear in the callers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtio/virtio_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index e626fa553c5a..a11028acf219 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -164,7 +164,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
164 r = virtqueue_add_buf(vq->vq, &sl, 1, 0, 164 r = virtqueue_add_buf(vq->vq, &sl, 1, 0,
165 dev->buf + started, 165 dev->buf + started,
166 GFP_ATOMIC); 166 GFP_ATOMIC);
167 if (likely(r >= 0)) { 167 if (likely(r == 0)) {
168 ++started; 168 ++started;
169 virtqueue_kick(vq->vq); 169 virtqueue_kick(vq->vq);
170 } 170 }
@@ -177,7 +177,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
177 r = 0; 177 r = 0;
178 } 178 }
179 179
180 } while (r >= 0); 180 } while (r == 0);
181 if (completed == completed_before) 181 if (completed == completed_before)
182 ++spurious; 182 ++spurious;
183 assert(completed <= bufs); 183 assert(completed <= bufs);