Skip to content

Commit

Permalink
drm/vmwgfx: use min_t to replace min
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bernard Zhao authored and Zack Rusin committed Apr 29, 2021
1 parent ed2684e commit cf63561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cf63561

Please sign in to comment.