summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2017-05-26 15:30:22 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2017-05-26 15:30:22 +0000
commit3476055c125a4fe06a6e600eb81ad674dae63859 (patch)
tree5352b9f831041f489deee90a48854b026ff3142a
parent253c638296576c471677a0e91affcf3776de8bfb (diff)
virtio: minor tweak
use qe_desc_base instead of calculating the address again
-rw-r--r--sys/dev/pv/virtio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pv/virtio.c b/sys/dev/pv/virtio.c
index 3ee0d253064..14b28c76bf6 100644
--- a/sys/dev/pv/virtio.c
+++ b/sys/dev/pv/virtio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtio.c,v 1.2 2017/05/26 10:59:55 krw Exp $ */
+/* $OpenBSD: virtio.c,v 1.3 2017/05/26 15:30:21 sf Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
@@ -729,8 +729,7 @@ virtio_enqueue_trim(struct virtqueue *vq, int slot, int nsegs)
struct vq_entry *qe1 = &vq->vq_entries[slot];
vd = &vq->vq_desc[qe1->qe_index];
vd->len = sizeof(struct vring_desc) * nsegs;
- vd = vq->vq_indirect;
- vd += vq->vq_maxnsegs * qe1->qe_index;
+ vd = qe1->qe_desc_base;
for (i = 0; i < nsegs; i++) {
vd[i].flags = VRING_DESC_F_NEXT;
if (i == (nsegs - 1))