Skip to content

Commit

Permalink
virtio: tools: make it clear that virtqueue_add_buf() no longer retur…
Browse files Browse the repository at this point in the history
…ns > 0

We simplified virtqueue_add_buf(), make it clear in the callers.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Dec 18, 2012
1 parent 4614e51 commit de929b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/virtio/virtio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
r = virtqueue_add_buf(vq->vq, &sl, 1, 0,
dev->buf + started,
GFP_ATOMIC);
if (likely(r >= 0)) {
if (likely(r == 0)) {
++started;
virtqueue_kick(vq->vq);
}
Expand All @@ -177,7 +177,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
r = 0;
}

} while (r >= 0);
} while (r == 0);
if (completed == completed_before)
++spurious;
assert(completed <= bufs);
Expand Down

0 comments on commit de929b0

Please sign in to comment.