* [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type
@ 2022-05-30 7:06 Evan Quan
2022-05-30 7:09 ` Chen, Guchun
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Evan Quan @ 2022-05-30 7:06 UTC (permalink / raw)
To: amd-gfx; +Cc: Alexander.Deucher, Evan Quan, kernel test robot, Dan Carpenter
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Evan Quan <evan.quan@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;
}
static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
--
2.29.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type
2022-05-30 7:06 [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type Evan Quan
@ 2022-05-30 7:09 ` Chen, Guchun
2022-05-30 7:12 ` Christian König
2022-05-31 10:09 ` Michel Dänzer
2 siblings, 0 replies; 4+ messages in thread
From: Chen, Guchun @ 2022-05-30 7:09 UTC (permalink / raw)
To: Quan, Evan, amd-gfx
Cc: Deucher, Alexander, Quan, Evan, kernel test robot, Dan Carpenter
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Regards,
Guchun
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Evan Quan
Sent: Monday, May 30, 2022 3:07 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Quan, Evan <Evan.Quan@amd.com>; kernel test robot <lkp@intel.com>; Dan Carpenter <dan.carpenter@oracle.com>
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?
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Evan Quan <evan.quan@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;
}
static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
--
2.29.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type
2022-05-30 7:06 [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type Evan Quan
2022-05-30 7:09 ` Chen, Guchun
@ 2022-05-30 7:12 ` Christian König
2022-05-31 10:09 ` Michel Dänzer
2 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2022-05-30 7:12 UTC (permalink / raw)
To: Evan Quan, amd-gfx; +Cc: Alexander.Deucher, kernel test robot, Dan Carpenter
Am 30.05.22 um 09:06 schrieb Evan Quan:
> 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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Christian König <christian.koenig@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;
> }
>
> static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type
2022-05-30 7:06 [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type Evan Quan
2022-05-30 7:09 ` Chen, Guchun
2022-05-30 7:12 ` Christian König
@ 2022-05-31 10:09 ` Michel Dänzer
2 siblings, 0 replies; 4+ messages in thread
From: Michel Dänzer @ 2022-05-31 10:09 UTC (permalink / raw)
To: Evan Quan, amd-gfx; +Cc: Alexander.Deucher, kernel test robot, Dan Carpenter
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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Evan Quan <evan.quan@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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-31 10:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 7:06 [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type Evan Quan
2022-05-30 7:09 ` Chen, Guchun
2022-05-30 7:12 ` Christian König
2022-05-31 10:09 ` Michel Dänzer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.