RE: [PATCH 1/2] drm/amd/pm: fix the uninitialized scalar variable waring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jesse Zhang
Sent: Friday, April 26, 2024 5:52 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Zhang, Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Zhang, Jesse(Jie) <Jesse.Zhang@xxxxxxx>
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@xxxxxxx>
---
 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@xxxxxxx>

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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux