diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-19 19:18:45 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-20 14:47:08 +0100 |
commit | b897a47450d6058d0acf2fe70ee90ea8fc65cb51 (patch) | |
tree | c4c626a987dd994adeeebeeabd835c0de05b7720 /hw | |
parent | 22953364f4f1f8fd27e08a02d480492be6c9960b (diff) | |
download | qemu-b897a47450d6058d0acf2fe70ee90ea8fc65cb51.zip qemu-b897a47450d6058d0acf2fe70ee90ea8fc65cb51.tar.gz qemu-b897a47450d6058d0acf2fe70ee90ea8fc65cb51.tar.bz2 |
hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument
The 'is_write' argument is either 0 or 1.
Convert it to a boolean type.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/vhost.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 9edfadc..0d226da 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -294,7 +294,7 @@ static int vhost_dev_has_iommu(struct vhost_dev *dev) } static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr, - hwaddr *plen, int is_write) + hwaddr *plen, bool is_write) { if (!vhost_dev_has_iommu(dev)) { return cpu_physical_memory_map(addr, plen, is_write); @@ -1012,21 +1012,21 @@ static int vhost_virtqueue_start(struct vhost_dev *dev, vq->desc_size = s = l = virtio_queue_get_desc_size(vdev, idx); vq->desc_phys = a; - vq->desc = vhost_memory_map(dev, a, &l, 0); + vq->desc = vhost_memory_map(dev, a, &l, false); if (!vq->desc || l != s) { r = -ENOMEM; goto fail_alloc_desc; } vq->avail_size = s = l = virtio_queue_get_avail_size(vdev, idx); vq->avail_phys = a = virtio_queue_get_avail_addr(vdev, idx); - vq->avail = vhost_memory_map(dev, a, &l, 0); + vq->avail = vhost_memory_map(dev, a, &l, false); if (!vq->avail || l != s) { r = -ENOMEM; goto fail_alloc_avail; } vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx); vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx); - vq->used = vhost_memory_map(dev, a, &l, 1); + vq->used = vhost_memory_map(dev, a, &l, true); if (!vq->used || l != s) { r = -ENOMEM; goto fail_alloc_used; |