drm_compat_ioctl(): tidy up a bit
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 25 May 2017 20:27:27 +0000 (16:27 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 4 Jul 2017 17:16:26 +0000 (13:16 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/gpu/drm/drm_ioc32.c

index 0e6ae9ceceb63ae99da4d20063523868ca2b22d5..7101b5141f00d783a4172a577aeaf03259ede5ca 100644 (file)
@@ -951,6 +951,7 @@ static struct {
 long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
        unsigned int nr = DRM_IOCTL_NR(cmd);
+       struct drm_file *file_priv = filp->private_data;
        drm_ioctl_compat_t *fn;
        int ret;
 
@@ -965,19 +966,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        if (!fn)
                return drm_ioctl(filp, cmd, arg);
 
-       if (drm_compat_ioctls[nr].name) {
-               struct drm_file *file_priv = filp->private_data;
-               DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",
-                         task_pid_nr(current),
-                         (long)old_encode_dev(file_priv->minor->kdev->devt),
-                         file_priv->authenticated,
-                         drm_compat_ioctls[nr].name);
-               ret = (*fn) (filp, cmd, arg);
-               if (ret)
-                       DRM_DEBUG("ret = %d\n", ret);
-       } else {
-               ret = (*fn) (filp, cmd, arg);
-       }
+       DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",
+                 task_pid_nr(current),
+                 (long)old_encode_dev(file_priv->minor->kdev->devt),
+                 file_priv->authenticated,
+                 drm_compat_ioctls[nr].name);
+       ret = (*fn)(filp, cmd, arg);
+       if (ret)
+               DRM_DEBUG("ret = %d\n", ret);
        return ret;
 }
 EXPORT_SYMBOL(drm_compat_ioctl);