From: Ville Syrjälä Date: Fri, 27 Mar 2015 13:51:59 +0000 (+0200) Subject: drm: Use max() to make the ioctl alloc size code cleaner X-Git-Tag: v4.1-rc1~69^2~19^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=53615af7a27400d252307093ce49768ccf6442a9;p=karo-tx-linux.git 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ä Signed-off-by: Daniel Vetter --- 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",