diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-12-03 18:01:58 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-12-09 21:42:02 +0200 |
commit | f30eaf4a09482c8dad0f65c616de10a2321839c9 (patch) | |
tree | a2fa0d476f8c7aa0c7d9a53fe1a762b5e88b1b49 /drivers/virtio | |
parent | 3ec7a77bb3089bb01032fdbd958eb5c29da58b49 (diff) | |
download | op-kernel-dev-f30eaf4a09482c8dad0f65c616de10a2321839c9.zip op-kernel-dev-f30eaf4a09482c8dad0f65c616de10a2321839c9.tar.gz |
virtio_pci: use priv for vq notification
slightly reduce the amount of pointer chasing this needs to do.
More importantly, this will easily generalize to virtio 1.0.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_pci.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 6a7b8bf..7b82eb5 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -204,11 +204,9 @@ static void vp_reset(struct virtio_device *vdev) /* the notify function used when creating a virt queue */ static bool vp_notify(struct virtqueue *vq) { - struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); - /* we write the queue's selector into the notification register to * signal the other end */ - iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY); + iowrite16(vq->index, (void __iomem *)vq->priv); return true; } @@ -437,6 +435,7 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, goto out_activate_queue; } + vq->priv = (void __force *)vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; info->vq = vq; if (msix_vec != VIRTIO_MSI_NO_VECTOR) { |