]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/vfio/vfio.c
Merge tag 'modules-for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
[linux.git] / drivers / vfio / vfio.c
index 388597930b648feafb04fb3a81a1b3ea43c0a749..c8482624ca34d8170e58143d606fa6b4fb8c7bfc 100644 (file)
@@ -1184,15 +1184,6 @@ static long vfio_fops_unl_ioctl(struct file *filep,
        return ret;
 }
 
-#ifdef CONFIG_COMPAT
-static long vfio_fops_compat_ioctl(struct file *filep,
-                                  unsigned int cmd, unsigned long arg)
-{
-       arg = (unsigned long)compat_ptr(arg);
-       return vfio_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
 static int vfio_fops_open(struct inode *inode, struct file *filep)
 {
        struct vfio_container *container;
@@ -1275,9 +1266,7 @@ static const struct file_operations vfio_fops = {
        .read           = vfio_fops_read,
        .write          = vfio_fops_write,
        .unlocked_ioctl = vfio_fops_unl_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = vfio_fops_compat_ioctl,
-#endif
+       .compat_ioctl   = compat_ptr_ioctl,
        .mmap           = vfio_fops_mmap,
 };
 
@@ -1556,15 +1545,6 @@ static long vfio_group_fops_unl_ioctl(struct file *filep,
        return ret;
 }
 
-#ifdef CONFIG_COMPAT
-static long vfio_group_fops_compat_ioctl(struct file *filep,
-                                        unsigned int cmd, unsigned long arg)
-{
-       arg = (unsigned long)compat_ptr(arg);
-       return vfio_group_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
 static int vfio_group_fops_open(struct inode *inode, struct file *filep)
 {
        struct vfio_group *group;
@@ -1620,9 +1600,7 @@ static int vfio_group_fops_release(struct inode *inode, struct file *filep)
 static const struct file_operations vfio_group_fops = {
        .owner          = THIS_MODULE,
        .unlocked_ioctl = vfio_group_fops_unl_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = vfio_group_fops_compat_ioctl,
-#endif
+       .compat_ioctl   = compat_ptr_ioctl,
        .open           = vfio_group_fops_open,
        .release        = vfio_group_fops_release,
 };
@@ -1687,24 +1665,13 @@ static int vfio_device_fops_mmap(struct file *filep, struct vm_area_struct *vma)
        return device->ops->mmap(device->device_data, vma);
 }
 
-#ifdef CONFIG_COMPAT
-static long vfio_device_fops_compat_ioctl(struct file *filep,
-                                         unsigned int cmd, unsigned long arg)
-{
-       arg = (unsigned long)compat_ptr(arg);
-       return vfio_device_fops_unl_ioctl(filep, cmd, arg);
-}
-#endif /* CONFIG_COMPAT */
-
 static const struct file_operations vfio_device_fops = {
        .owner          = THIS_MODULE,
        .release        = vfio_device_fops_release,
        .read           = vfio_device_fops_read,
        .write          = vfio_device_fops_write,
        .unlocked_ioctl = vfio_device_fops_unl_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = vfio_device_fops_compat_ioctl,
-#endif
+       .compat_ioctl   = compat_ptr_ioctl,
        .mmap           = vfio_device_fops_mmap,
 };