[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument |
Date: |
Thu, 20 Feb 2020 14:05:41 +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/virtio.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 2c5410e981..9d06dbe3ef 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1293,7 +1293,7 @@ static void virtqueue_undo_map_desc(unsigned int out_num,
unsigned int in_num,
static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg,
hwaddr *addr, unsigned int num_sg,
- int is_write)
+ bool is_write)
{
unsigned int i;
hwaddr len;
@@ -1317,8 +1317,9 @@ static void virtqueue_map_iovec(VirtIODevice *vdev,
struct iovec *sg,
void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem)
{
- virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, 1);
- virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num, 0);
+ virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, true);
+ virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num,
+ false);
}
static void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned
in_num)
--
2.21.1
- RE: [Xen-devel] [PATCH v3 03/20] exec: Let qemu_ram_*() functions take a const pointer argument, (continued)
- [PATCH v3 04/20] exec: Rename ram_ptr variable, Philippe Mathieu-Daudé, 2020/02/20
- [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 08/20] Remove unnecessary cast when using the address_space API, 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 11/20] hw/ide/internal: Remove unused DMARestartFunc typedef, 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 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument,
Philippe Mathieu-Daudé <=
- [PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [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 10/20] Remove unnecessary cast when using the cpu_[physical]_memory API, 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