[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_wri
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument |
Date: |
Thu, 20 Feb 2020 14:05:42 +0100 |
The 'is_write' argument is either 0 or 1.
Convert it to a boolean type.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/virtio/vhost.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 9edfadc81d..0d226dae10 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;
--
2.21.1
- [PATCH v3 05/20] exec: Let flatview API take void pointer arguments, (continued)
- [PATCH v3 05/20] exec: Let flatview API take void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 06/20] exec: Let the address_space API use void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 07/20] hw/net: Avoid casting non-const pointer, use address_space_write(), Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 09/20] exec: Let the cpu_[physical]_memory API use void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 08/20] Remove unnecessary cast when using the address_space API, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 10/20] Remove unnecessary cast when using the cpu_[physical]_memory API, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 11/20] hw/ide/internal: Remove unused DMARestartFunc typedef, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 12/20] hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument,
Philippe Mathieu-Daudé <=
- [PATCH v3 15/20] exec: Let address_space_unmap() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 16/20] Let address_space_rw() calls pass a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 18/20] exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 17/20] Avoid address_space_rw() with a constant is_write argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 19/20] Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20