drm: Rewrite drm_ioctl_flags() to resemble the new drm_ioctl() code
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 Mar 2015 13:52:00 +0000 (15:52 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 27 Mar 2015 15:08:52 +0000 (16:08 +0100)
Use the same logic when checking for valid ioctl range in
drm_ioctl_flags() that is used in drm_ioctl() to avoid
confusion.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_ioctl.c

index 4a2bf2b857ecbb1ee40eb1ee767349a0f98c0e6e..1f257aecd2b26002e45f68b1c05d737f90a03a03 100644 (file)
@@ -766,12 +766,13 @@ EXPORT_SYMBOL(drm_ioctl);
  */
 bool drm_ioctl_flags(unsigned int nr, unsigned int *flags)
 {
-       if ((nr >= DRM_COMMAND_END && nr < DRM_CORE_IOCTL_COUNT) ||
-           (nr < DRM_COMMAND_BASE)) {
-               *flags = drm_ioctls[nr].flags;
-               return true;
-       }
+       if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END)
+               return false;
+
+       if (nr >= DRM_CORE_IOCTL_COUNT)
+               return false;
 
-       return false;
+       *flags = drm_ioctls[nr].flags;
+       return true;
 }
 EXPORT_SYMBOL(drm_ioctl_flags);