[PATCH] drm/amdkfd: fix comparison warning with min() macro

Christian König christian.koenig at amd.com
Fri Mar 25 07:58:48 UTC 2022



Am 24.03.22 um 22:31 schrieb Alex Deucher:
> Properly case to u32 to fix the warning.
>
> Fixes: 83f1287c57228f ("drm/amdkfd: Fix Incorrect VMIDs passed to HWS")
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index d70f787369a0..62aa6c9d5123 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -484,7 +484,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
>   
>   	/* Verify module parameters regarding mapped process number*/
>   	if (hws_max_conc_proc >= 0)
> -		kfd->max_proc_per_quantum = min(hws_max_conc_proc, kfd->vm_info.vmid_num_kfd);
> +		kfd->max_proc_per_quantum = min((u32)hws_max_conc_proc, kfd->vm_info.vmid_num_kfd);

You could use min_t() her instead of the manual casting.

Christian.

>   	else
>   		kfd->max_proc_per_quantum = kfd->vm_info.vmid_num_kfd;
>   



More information about the amd-gfx mailing list