Commit e81d1ad3 authored by Paul Bolle's avatar Paul Bolle Committed by Paolo Bonzini

kvm: vfio: silence GCC warning

Building vfio.o triggers a GCC warning (when building for 32 bits x86):
    arch/x86/kvm/../../../virt/kvm/vfio.c: In function 'kvm_vfio_set_group':
    arch/x86/kvm/../../../virt/kvm/vfio.c:104:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      void __user *argp = (void __user *)arg;
                          ^

Silence this warning by casting arg to unsigned long.

argp's current type, "void __user *", is always casted to "int32_t
__user *". So its type might as well be changed to "int32_t __user *".
Signed-off-by: default avatarPaul Bolle <pebolle@tiscali.nl>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 26a865f4
...@@ -101,14 +101,14 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg) ...@@ -101,14 +101,14 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
struct kvm_vfio *kv = dev->private; struct kvm_vfio *kv = dev->private;
struct vfio_group *vfio_group; struct vfio_group *vfio_group;
struct kvm_vfio_group *kvg; struct kvm_vfio_group *kvg;
void __user *argp = (void __user *)arg; int32_t __user *argp = (int32_t __user *)(unsigned long)arg;
struct fd f; struct fd f;
int32_t fd; int32_t fd;
int ret; int ret;
switch (attr) { switch (attr) {
case KVM_DEV_VFIO_GROUP_ADD: case KVM_DEV_VFIO_GROUP_ADD:
if (get_user(fd, (int32_t __user *)argp)) if (get_user(fd, argp))
return -EFAULT; return -EFAULT;
f = fdget(fd); f = fdget(fd);
...@@ -148,7 +148,7 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg) ...@@ -148,7 +148,7 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
return 0; return 0;
case KVM_DEV_VFIO_GROUP_DEL: case KVM_DEV_VFIO_GROUP_DEL:
if (get_user(fd, (int32_t __user *)argp)) if (get_user(fd, argp))
return -EFAULT; return -EFAULT;
f = fdget(fd); f = fdget(fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment