On 1/18/24 06:09, Peter Xu wrote:
On Wed, Jan 17, 2024 at 05:03:44PM +0100, Paolo Bonzini wrote:
Do not use uint64_t for the type of the declaration and __u64 when
computing the number of elements in the array.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
hw/vfio/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 0b3352f2a9d..0da4003ecf5 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1118,7 +1118,7 @@ static int vfio_device_dma_logging_report(VFIODevice
*vbasedev, hwaddr iova,
{
uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature) +
sizeof(struct vfio_device_feature_dma_logging_report),
- sizeof(__u64))] = {};
+ sizeof(uint64_t))] = {};
struct vfio_device_feature *feature = (struct vfio_device_feature *)buf;
struct vfio_device_feature_dma_logging_report *report =
(struct vfio_device_feature_dma_logging_report *)feature->data;
There seem to have other places in the sme file that reference __u64. Are
we going to remove all __u64 references? Or maybe something else?
AFAIUI, this change is to match the types of the 'buf' array and
the one used by sizeof.
Copy Alex/Cedric to make sure this won't get lost..
Applied to vfio-next.
Thanks,
C.