diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-03-27 13:52:00 (GMT) |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-27 15:08:52 (GMT) |
commit | 7ef5f82b100716b23de7d2da6ff602b0842e5804 (patch) | |
tree | ba336619b6480f573e1e3f7312806c35363e4bed /drivers/gpu/drm/drm_ioctl.c | |
parent | 53615af7a27400d252307093ce49768ccf6442a9 (diff) | |
download | linux-7ef5f82b100716b23de7d2da6ff602b0842e5804.tar.xz |
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>
Diffstat (limited to 'drivers/gpu/drm/drm_ioctl.c')
-rw-r--r-- | drivers/gpu/drm/drm_ioctl.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 4a2bf2b..1f257ae 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -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); |