[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 3/5] util/vfio-helpers: Store eventfd using int32_t type
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH v3 3/5] util/vfio-helpers: Store eventfd using int32_t type |
Date: |
Tue, 18 Aug 2020 18:45:07 +0200 |
Per the documentation in linux-headers/linux/vfio.h:
VFIO_DEVICE_SET_IRQS
* DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
Replace the 'int' by an 'int32_t' to match the documentation.
Fixes: 418026ca43 ("util: Introduce vfio helpers")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
util/vfio-helpers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index 60017936e3e..696f2d51712 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -193,7 +193,7 @@ int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier
*e,
return -EINVAL;
}
- irq_set_size = sizeof(*irq_set) + sizeof(int);
+ irq_set_size = sizeof(*irq_set) + sizeof(int32_t);
irq_set = g_malloc0(irq_set_size);
/* Get to a known IRQ state */
@@ -205,7 +205,7 @@ int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier
*e,
.count = 1,
};
- *(int *)&irq_set->data = event_notifier_get_fd(e);
+ *(int32_t *)&irq_set->data = event_notifier_get_fd(e);
r = ioctl(s->device, VFIO_DEVICE_SET_IRQS, irq_set);
g_free(irq_set);
if (r) {
--
2.26.2