[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 092/136] hw/virtio: Let vhost_memory_map() use a boolean 'is_write
From: |
Paolo Bonzini |
Subject: |
[PULL 092/136] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument |
Date: |
Tue, 25 Feb 2020 12:50:22 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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 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;
--
1.8.3.1
- [PULL 072/136] remove no longer used memory_region_allocate_system_memory(), (continued)
- [PULL 072/136] remove no longer used memory_region_allocate_system_memory(), Paolo Bonzini, 2020/02/25
- [PULL 080/136] scripts/git.orderfile: Display Cocci scripts before code modifications, Paolo Bonzini, 2020/02/25
- [PULL 082/136] exec: Rename ram_ptr variable, Paolo Bonzini, 2020/02/25
- [PULL 084/136] exec: Let the address_space API use void pointer arguments, Paolo Bonzini, 2020/02/25
- [PULL 087/136] exec: Let the cpu_[physical]_memory API use void pointer arguments, Paolo Bonzini, 2020/02/25
- [PULL 089/136] hw/ide/internal: Remove unused DMARestartFunc typedef, Paolo Bonzini, 2020/02/25
- [PULL 086/136] Remove unnecessary cast when using the address_space API, Paolo Bonzini, 2020/02/25
- [PULL 088/136] Remove unnecessary cast when using the cpu_[physical]_memory API, Paolo Bonzini, 2020/02/25
- [PULL 090/136] hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 091/136] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 092/136] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument,
Paolo Bonzini <=
- [PULL 093/136] exec: Let address_space_unmap() use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 096/136] exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 094/136] Let address_space_rw() calls pass a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 099/136] memory: Correctly return alias region type, Paolo Bonzini, 2020/02/25
- [PULL 097/136] Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 098/136] Avoid cpu_physical_memory_rw() with a constant is_write argument, Paolo Bonzini, 2020/02/25
- [PULL 095/136] Avoid address_space_rw() with a constant is_write argument, Paolo Bonzini, 2020/02/25
- [PULL 102/136] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Paolo Bonzini, 2020/02/25
- [PULL 100/136] memory: Simplify memory_region_init_rom_nomigrate() to ease review, Paolo Bonzini, 2020/02/25
- [PULL 101/136] scripts/cocci: Rename memory-region-{init-ram -> housekeeping}, Paolo Bonzini, 2020/02/25