Re: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized

2020-10-27 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only]

Series is:
Reviewed-by: Alex Deucher 

From: Quan, Evan 
Sent: Tuesday, October 27, 2020 10:45 PM
To: amd-gfx@lists.freedesktop.org 
Cc: Deucher, Alexander ; Quan, Evan 
; kernel test robot 
Subject: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used 
uninitialized

Fix the compile warnings below:
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: 
>> warning: variable 'min' is used uninitialized whenever 'if' condition is 
>> false [-Wsometimes-uninitialized]
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: 
>> warning: variable 'max' is used uninitialized whenever 'if' condition is 
>> false [-Wsometimes-uninitialized]

Change-Id: Id2dece80162cd10f004abbf3b62cba0c84e988f2
Signed-off-by: Evan Quan 
Reported-by: kernel test robot 
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
index 49db61a89505..5937150e6b37 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
@@ -1856,7 +1856,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 {
 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
 struct amdgpu_device *adev = hwmgr->adev;
-   uint32_t asicrev1, evv_revision, max, min;
+   uint32_t asicrev1, evv_revision, max = 0, min = 0;

 atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, 
STRAP_EVV_REVISION_MSB,
 _revision);
@@ -1893,8 +1893,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 max = 2500;
 }
 }
-   } else if ((hwmgr->chip_id == CHIP_POLARIS11) ||
-  (hwmgr->chip_id == CHIP_POLARIS12)) {
+   } else {
 min = 1100;
 max = 2100;
 }
--
2.29.0

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized

2020-10-27 Thread Evan Quan
Fix the compile warnings below:
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: 
>> warning: variable 'min' is used uninitialized whenever 'if' condition is 
>> false [-Wsometimes-uninitialized]
>> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: 
>> warning: variable 'max' is used uninitialized whenever 'if' condition is 
>> false [-Wsometimes-uninitialized]

Change-Id: Id2dece80162cd10f004abbf3b62cba0c84e988f2
Signed-off-by: Evan Quan 
Reported-by: kernel test robot 
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c 
b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
index 49db61a89505..5937150e6b37 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
@@ -1856,7 +1856,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
 {
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
struct amdgpu_device *adev = hwmgr->adev;
-   uint32_t asicrev1, evv_revision, max, min;
+   uint32_t asicrev1, evv_revision, max = 0, min = 0;
 
atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, 
STRAP_EVV_REVISION_MSB,
_revision);
@@ -1893,8 +1893,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr)
max = 2500;
}
}
-   } else if ((hwmgr->chip_id == CHIP_POLARIS11) ||
-  (hwmgr->chip_id == CHIP_POLARIS12)) {
+   } else {
min = 1100;
max = 2100;
}
-- 
2.29.0

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx