]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm: Use max() to make the ioctl alloc size code cleaner
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 Mar 2015 13:51:59 +0000 (15:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 27 Mar 2015 15:08:46 +0000 (16:08 +0100)
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>
drivers/gpu/drm/drm_ioctl.c

index 68ba014886c2039500c2045df609c98641a658c5..4a2bf2b857ecbb1ee40eb1ee767349a0f98c0e6e 100644 (file)
@@ -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",