summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBernard Zhao <bernard@vivo.com>2020-11-18 17:11:46 -0800
committerZack Rusin <zackr@vmware.com>2021-04-29 14:54:54 -0400
commitcf63561cbae71bc141346aa74783ebf0a7c52fbf (patch)
tree1a16b513e30b8b6428d4c005c98028b96280929a /drivers/gpu
parented2684e7051a550f29af9075a55dbb8b1dd6de53 (diff)
drm/vmwgfx: use min_t to replace min
Use min_t to replace min, min_t is a bit fast because min use twice typeof. This patch also fix check_patch.pl warning: WARNING: min() should probably be min_t(unsigned long, num_pages, VMW_PPN_PER_REMAP) +unsigned long nr = min(num_pages, (unsigned long) VMW_PPN_PER_REMAP); Signed-off-by: Bernard Zhao <bernard@vivo.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Zack Rusin <zackr@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201119011146.107587-1-bernard@vivo.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
index 964ddf1ca57a..c482e5298e11 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
@@ -72,7 +72,7 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
SVGA_REMAP_GMR2_PPN64 : SVGA_REMAP_GMR2_PPN32;
while (num_pages > 0) {
- unsigned long nr = min(num_pages, (unsigned long)VMW_PPN_PER_REMAP);
+ unsigned long nr = min_t(unsigned long, num_pages, VMW_PPN_PER_REMAP);
remap_cmd.offsetPages = remap_pos;
remap_cmd.numPages = nr;