[PATCH] drm/amdgpu: suppress the compile warning about 64 bit type

Michel Dänzer michel.daenzer at mailbox.org
Tue May 31 10:09:38 UTC 2022


On 2022-05-30 09:06, Evan Quan wrote:
> Suppress the compile warning below:
> drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292
> gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
> 
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Signed-off-by: Evan Quan <evan.quan at amd.com>
> Change-Id: If5f83daeb4039d87c5b47c221f9c963c941400e1
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index cb581cfc7464..9039021361a8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -1316,7 +1316,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade
>  		memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
>  
>  	if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
> -		*(uint64_t *)fw_autoload_mask |= 1 << id;
> +		*(uint64_t *)fw_autoload_mask |= 1ULL << id;
>  }

This doesn't just suppress the warning, it actually fixes the bug where the code wouldn't have worked as intended for id >= 32.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


More information about the amd-gfx mailing list