Explorar o código

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>
Ville Syrjälä %!s(int64=10) %!d(string=hai) anos
pai
achega
53615af7a2
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      drivers/gpu/drm/drm_ioctl.c

+ 2 - 3
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",