aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-03-27 09:52:00 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-27 11:08:52 -0400
commit7ef5f82b100716b23de7d2da6ff602b0842e5804 (patch)
treeba336619b6480f573e1e3f7312806c35363e4bed
parent53615af7a27400d252307093ce49768ccf6442a9 (diff)
drm: Rewrite drm_ioctl_flags() to resemble the new drm_ioctl() code
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>
-rw-r--r--drivers/gpu/drm/drm_ioctl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 4a2bf2b857ec..1f257aecd2b2 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -766,12 +766,13 @@ EXPORT_SYMBOL(drm_ioctl);
766 */ 766 */
767bool drm_ioctl_flags(unsigned int nr, unsigned int *flags) 767bool drm_ioctl_flags(unsigned int nr, unsigned int *flags)
768{ 768{
769 if ((nr >= DRM_COMMAND_END && nr < DRM_CORE_IOCTL_COUNT) || 769 if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END)
770 (nr < DRM_COMMAND_BASE)) { 770 return false;
771 *flags = drm_ioctls[nr].flags; 771
772 return true; 772 if (nr >= DRM_CORE_IOCTL_COUNT)
773 } 773 return false;
774 774
775 return false; 775 *flags = drm_ioctls[nr].flags;
776 return true;
776} 777}
777EXPORT_SYMBOL(drm_ioctl_flags); 778EXPORT_SYMBOL(drm_ioctl_flags);