Skip to contentSkip to conversation

drm/amd/pm: fix the compile warning

PATCH Superseded Evan Quan 2 participants 2 messages Apr 25, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/pm: fix the compile warning

Fix the compile warning below:
drivers/gpu/drm/amd/amdgpu/../pm/legacy-dpm/kv_dpm.c:1641
kv_get_acp_boot_level() warn: always true condition '(table->entries[i]->clk >= 0) => (0-u32max >= 0)'

CC Alex Deucher <[email protected]>
Change-Id If4985252017023d6711b4d7eb1192a397baff813
---
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +3 -0
index 8b23cc9f098a..cab948118d4b 100644
@@ -1623,6 +1623,7 @@ static int kv_update_samu_dpm(struct amdgpu_device *adev, bool gate)
 
 static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
 {
+#if 0
 	u8 i;
 	struct amdgpu_clock_voltage_dependency_table *table =
 		&adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
@@ -1636,6 +1637,8 @@ static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
 		i = table->count - 1;
 
 	return i;
+#endif
+	return 0;
 }
 
 static void kv_update_acp_boot_level(struct amdgpu_device *adev)
Signature · 1 line
2.29.0
#1 lore raw
Quoted 26 lines · Evan Quan

Fix the compile warning below:
drivers/gpu/drm/amd/amdgpu/../pm/legacy-dpm/kv_dpm.c:1641
kv_get_acp_boot_level() warn: always true condition '(table->entries[i]->clk >= 0) => (0-u32max >= 0)'

CC Alex Deucher <[email protected]>
Change-Id If4985252017023d6711b4d7eb1192a397baff813
---
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +1 -0
index 8b23cc9f098a..cab948118d4b 100644
@@ -1623,6 +1623,7 @@ static int kv_update_samu_dpm(struct amdgpu_device *adev, bool gate)
 
 static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
 {
+#if 0
        u8 i;
        struct amdgpu_clock_voltage_dependency_table *table =
                &adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;

drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c static u8 kv_get_acp_boot_level(struct amdgpu_device *adev) · line 1640

Quoted 4 lines
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +1 -0
@@ -1636,6 +1637,8 @@ static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
                i = table->count - 1;
 
        return i;
+#endif

Just drop the code at this point and return 0.

Alex

Quoted 7 lines
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +1 -1
+       return 0;
 }
 
 static void kv_update_acp_boot_level(struct amdgpu_device *adev)
--

2.29.0