drm/amdgpu: suppress the compile warning about 64 bit type
Subsystems (2)
PATCH 1/1 drm/amdgpu: suppress the compile warning about 64 bit type
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?
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -1316,7 +1316,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adememset (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; } static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
Signature · 1 line
2.29.0
Regards,
Guchun
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Monday, May 30, 2022 3:07 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; kernel test robot <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type
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?
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -1316,7 +1316,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adememset (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; } static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
Signature · 1 line
2.29.0
Am 30.05.22 um 09:06 schrieb Evan Quan:
Quoted 7 lines
Suppress the compile warning below:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292gfx_v11_0_rlc_backdoor_autoload_copy_ucode()warn: should '1 << id' be a 64 bit type?Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Evan Quan <[email protected]>
Quoted 18 lines
Change-Id: If5f83daeb4039d87c5b47c221f9c963c941400e1
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1
-1@@ -1316,7 +1316,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adememset (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; } static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
Quoted 17 lines · Evan Quan
Suppress the compile warning below:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292gfx_v11_0_rlc_backdoor_autoload_copy_ucode()warn: should '1 << id' be a 64 bit type?Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Evan Quan <[email protected]>Change-Id If5f83daeb4039d87c5b47c221f9c963c941400e1--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade · line 1320
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1
-1@@ -1316,7 +1316,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adememset (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.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer