* [PATCH V2] drm/amd/pm: fix the compile warning
@ 2022-04-26 9:47 Evan Quan
2022-04-26 13:08 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Evan Quan @ 2022-04-26 9:47 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher, Evan Quan, kernel test robot
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)'
Reported-by: kernel test robot <lkp@intel.com>
CC: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Change-Id: If4985252017023d6711b4d7eb1192a397baff813
--
v1->v2:
- drop dead code(Alex)
---
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index 8b23cc9f098a..8fd0782a2b20 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -1623,19 +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)
{
- u8 i;
- struct amdgpu_clock_voltage_dependency_table *table =
- &adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
-
- for (i = 0; i < table->count; i++) {
- if (table->entries[i].clk >= 0) /* XXX */
- break;
- }
-
- if (i >= table->count)
- i = table->count - 1;
-
- return i;
+ return 0;
}
static void kv_update_acp_boot_level(struct amdgpu_device *adev)
--
2.29.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2] drm/amd/pm: fix the compile warning
2022-04-26 9:47 [PATCH V2] drm/amd/pm: fix the compile warning Evan Quan
@ 2022-04-26 13:08 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2022-04-26 13:08 UTC (permalink / raw)
To: Evan Quan; +Cc: Alex Deucher, kernel test robot, amd-gfx list
On Tue, Apr 26, 2022 at 5:47 AM Evan Quan <evan.quan@amd.com> wrote:
>
> 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)'
>
> Reported-by: kernel test robot <lkp@intel.com>
> CC: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Change-Id: If4985252017023d6711b4d7eb1192a397baff813
> --
> v1->v2:
> - drop dead code(Alex)
> ---
> drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> index 8b23cc9f098a..8fd0782a2b20 100644
> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> @@ -1623,19 +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)
> {
> - u8 i;
> - struct amdgpu_clock_voltage_dependency_table *table =
> - &adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
> -
> - for (i = 0; i < table->count; i++) {
> - if (table->entries[i].clk >= 0) /* XXX */
> - break;
> - }
> -
> - if (i >= table->count)
> - i = table->count - 1;
> -
> - return i;
> + return 0;
> }
>
> static void kv_update_acp_boot_level(struct amdgpu_device *adev)
> --
> 2.29.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-26 13:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 9:47 [PATCH V2] drm/amd/pm: fix the compile warning Evan Quan
2022-04-26 13:08 ` Alex Deucher
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.