All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring
@ 2024-04-26  9:52 Jesse Zhang
  2024-04-28  6:25 ` Huang, Tim
  2024-04-28  6:48 ` Wang, Yang(Kevin)
  0 siblings, 2 replies; 3+ messages in thread
From: Jesse Zhang @ 2024-04-26  9:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, Tim.Huang, Jesse Zhang, Jesse Zhang

Initialize variable size before calling
hwmgr->hwmgr_func->iread_sensor, such as smu7_read_sensor.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
index 5fb21a0508cd..ec2b6d0674ed 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
@@ -102,6 +102,7 @@ static void pp_swctf_delayed_work_handler(struct work_struct *work)
 	uint32_t gpu_temperature, size;
 	int ret;
 
+	size = sizeof(gpu_temperature);
 	/*
 	 * If the hotspot/edge temperature is confirmed as below SW CTF setting point
 	 * after the delay enforced, nothing will be done.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring
  2024-04-26  9:52 [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring Jesse Zhang
@ 2024-04-28  6:25 ` Huang, Tim
  2024-04-28  6:48 ` Wang, Yang(Kevin)
  1 sibling, 0 replies; 3+ messages in thread
From: Huang, Tim @ 2024-04-28  6:25 UTC (permalink / raw)
  To: Zhang, Jesse(Jie), amd-gfx
  Cc: Deucher, Alexander, Koenig, Christian, Zhang, Jesse(Jie),
	Zhang, Jesse(Jie)

[AMD Official Use Only - General]

This patch is,

Reviewed-by: Tim Huang <Tim.Huang@amd.com>

Best Regards,
Tim Huang



> -----Original Message-----
> From: Jesse Zhang <jesse.zhang@amd.com>
> Sent: Friday, April 26, 2024 5:52 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Huang, Tim <Tim.Huang@amd.com>; Zhang,
> Jesse(Jie) <Jesse.Zhang@amd.com>; Zhang, Jesse(Jie)
> <Jesse.Zhang@amd.com>
> Subject: [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring
>
> Initialize variable size before calling
> hwmgr->hwmgr_func->iread_sensor, such as smu7_read_sensor.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
> ---
>  drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> index 5fb21a0508cd..ec2b6d0674ed 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> @@ -102,6 +102,7 @@ static void pp_swctf_delayed_work_handler(struct
> work_struct *work)
>       uint32_t gpu_temperature, size;
>       int ret;
>
> +     size = sizeof(gpu_temperature);
>       /*
>        * If the hotspot/edge temperature is confirmed as below SW CTF
> setting point
>        * after the delay enforced, nothing will be done.
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring
  2024-04-26  9:52 [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring Jesse Zhang
  2024-04-28  6:25 ` Huang, Tim
@ 2024-04-28  6:48 ` Wang, Yang(Kevin)
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Yang(Kevin) @ 2024-04-28  6:48 UTC (permalink / raw)
  To: Zhang, Jesse(Jie), amd-gfx
  Cc: Deucher, Alexander, Koenig, Christian, Huang, Tim, Zhang,
	Jesse(Jie), Zhang, Jesse(Jie)

[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Jesse Zhang
Sent: Friday, April 26, 2024 5:52 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Huang, Tim <Tim.Huang@amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>
Subject: [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring

Initialize variable size before calling
hwmgr->hwmgr_func->iread_sensor, such as smu7_read_sensor.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
index 5fb21a0508cd..ec2b6d0674ed 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
@@ -102,6 +102,7 @@ static void pp_swctf_delayed_work_handler(struct work_struct *work)
        uint32_t gpu_temperature, size;
        int ret;

+       size = sizeof(gpu_temperature);

[Kevin]:
You can directly initialize during the declaration phase to avoid reassignment.

With fixed, the patch is
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>

Best Regards,
Kevin
        /*
         * If the hotspot/edge temperature is confirmed as below SW CTF setting point
         * after the delay enforced, nothing will be done.
--
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-28  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  9:52 [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring Jesse Zhang
2024-04-28  6:25 ` Huang, Tim
2024-04-28  6:48 ` Wang, Yang(Kevin)

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.