summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_ioctl.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-03-27 15:51:59 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-27 16:08:46 +0100
commit53615af7a27400d252307093ce49768ccf6442a9 (patch)
tree122fb87b30091a79ec3d6fed6b7cea97a335344f /drivers/gpu/drm/drm_ioctl.c
parent83be003807415a07465fc5d748803b702409f3da (diff)
drm: Use max() to make the ioctl alloc size code cleaner
Use max() to make the code to determine the allocation size for the ioctl data easier to read. 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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 68ba014886c2..4a2bf2b857ec 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -683,9 +683,8 @@ long drm_ioctl(struct file *filp,
}
drv_size = _IOC_SIZE(ioctl->cmd);
- usize = asize = _IOC_SIZE(cmd);
- if (drv_size > asize)
- asize = drv_size;
+ usize = _IOC_SIZE(cmd);
+ asize = max(usize, drv_size);
cmd = ioctl->cmd;
DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",