aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/vfio.c
diff options
context:
space:
mode:
authorPaul Bolle <pebolle@tiscali.nl>2014-01-09 19:28:46 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2014-01-15 06:01:48 -0500
commite81d1ad32753cdeaef56b9bffe3b8ab7b5c776e5 (patch)
treea91791b215e5cc0aa37e5ad031ef5b9b3da249cc /virt/kvm/vfio.c
parent26a865f4aa8e66a6d94958de7656f7f1b03c6c56 (diff)
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: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm/vfio.c')
-rw-r--r--virt/kvm/vfio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c
index ca4260e35037..b4f9507ae650 100644
--- a/virt/kvm/vfio.c
+++ b/virt/kvm/vfio.c
@@ -101,14 +101,14 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
101 struct kvm_vfio *kv = dev->private; 101 struct kvm_vfio *kv = dev->private;
102 struct vfio_group *vfio_group; 102 struct vfio_group *vfio_group;
103 struct kvm_vfio_group *kvg; 103 struct kvm_vfio_group *kvg;
104 void __user *argp = (void __user *)arg; 104 int32_t __user *argp = (int32_t __user *)(unsigned long)arg;
105 struct fd f; 105 struct fd f;
106 int32_t fd; 106 int32_t fd;
107 int ret; 107 int ret;
108 108
109 switch (attr) { 109 switch (attr) {
110 case KVM_DEV_VFIO_GROUP_ADD: 110 case KVM_DEV_VFIO_GROUP_ADD:
111 if (get_user(fd, (int32_t __user *)argp)) 111 if (get_user(fd, argp))
112 return -EFAULT; 112 return -EFAULT;
113 113
114 f = fdget(fd); 114 f = fdget(fd);
@@ -148,7 +148,7 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg)
148 return 0; 148 return 0;
149 149
150 case KVM_DEV_VFIO_GROUP_DEL: 150 case KVM_DEV_VFIO_GROUP_DEL:
151 if (get_user(fd, (int32_t __user *)argp)) 151 if (get_user(fd, argp))
152 return -EFAULT; 152 return -EFAULT;
153 153
154 f = fdget(fd); 154 f = fdget(fd);