virtio: Use u32 instead of int in pci_data_in/out
The PCI access size type is changed from a signed type
to an unsigned type since the size is never expected to
be negative, and the type also matches the type in the
signature of virtio_pci__io_mmio_callback.
This change simplifies size checking in the next patch.
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Martin Radev <martin.b.radev@gmail.com>
Link: https://lore.kernel.org/r/20220509203940.754644-4-martin.b.radev@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
diff --git a/virtio/pci.c b/virtio/pci.c
index 2777d1c..bcb205a 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -116,7 +116,7 @@
}
static bool virtio_pci__specific_data_in(struct kvm *kvm, struct virtio_device *vdev,
- void *data, int size, unsigned long offset)
+ void *data, u32 size, unsigned long offset)
{
u32 config_offset;
struct virtio_pci *vpci = vdev->virtio;
@@ -146,7 +146,7 @@
}
static bool virtio_pci__data_in(struct kvm_cpu *vcpu, struct virtio_device *vdev,
- unsigned long offset, void *data, int size)
+ unsigned long offset, void *data, u32 size)
{
bool ret = true;
struct virtio_pci *vpci;
@@ -211,7 +211,7 @@
}
static bool virtio_pci__specific_data_out(struct kvm *kvm, struct virtio_device *vdev,
- void *data, int size, unsigned long offset)
+ void *data, u32 size, unsigned long offset)
{
struct virtio_pci *vpci = vdev->virtio;
u32 config_offset, vec;
@@ -285,7 +285,7 @@
}
static bool virtio_pci__data_out(struct kvm_cpu *vcpu, struct virtio_device *vdev,
- unsigned long offset, void *data, int size)
+ unsigned long offset, void *data, u32 size)
{
bool ret = true;
struct virtio_pci *vpci;