aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-02-04 23:50:05 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-02-04 07:50:05 -0500
commit15f9c8903cbdb02aee0f1bcf86a97c2e238b9a3d (patch)
treea215ccf3f745e52ae67aed1ac822baa57326b9b6 /drivers/virtio
parent0ad07ec1fd2f3e90dfb086b04c07a83db40e9172 (diff)
virtio: Use the sg_phys convenience function.
Simple cleanup. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_ring.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 9859213aa658..74c245092b5c 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -99,16 +99,14 @@ static int vring_add_buf(struct virtqueue *_vq,
99 head = vq->free_head; 99 head = vq->free_head;
100 for (i = vq->free_head; out; i = vq->vring.desc[i].next, out--) { 100 for (i = vq->free_head; out; i = vq->vring.desc[i].next, out--) {
101 vq->vring.desc[i].flags = VRING_DESC_F_NEXT; 101 vq->vring.desc[i].flags = VRING_DESC_F_NEXT;
102 vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<<PAGE_SHIFT) 102 vq->vring.desc[i].addr = sg_phys(sg);
103 + sg->offset;
104 vq->vring.desc[i].len = sg->length; 103 vq->vring.desc[i].len = sg->length;
105 prev = i; 104 prev = i;
106 sg++; 105 sg++;
107 } 106 }
108 for (; in; i = vq->vring.desc[i].next, in--) { 107 for (; in; i = vq->vring.desc[i].next, in--) {
109 vq->vring.desc[i].flags = VRING_DESC_F_NEXT|VRING_DESC_F_WRITE; 108 vq->vring.desc[i].flags = VRING_DESC_F_NEXT|VRING_DESC_F_WRITE;
110 vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<<PAGE_SHIFT) 109 vq->vring.desc[i].addr = sg_phys(sg);
111 + sg->offset;
112 vq->vring.desc[i].len = sg->length; 110 vq->vring.desc[i].len = sg->length;
113 prev = i; 111 prev = i;
114 sg++; 112 sg++;