Skip to content

Commit

Permalink
drm: Use max() to make the ioctl alloc size code cleaner
Browse files Browse the repository at this point in the history
Use max() to make the code to determine the allocation size for
the ioctl data easier to read.

Signed-off-by: Ville Syrjälä <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
  • Loading branch information
vsyrjala authored and danvet committed Mar 27, 2015
1 parent 83be003 commit 53615af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/drm_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 53615af

Please sign in to comment.