Skip to content

Commit

Permalink
drm/amd/pm: fix the compile warning
Browse files Browse the repository at this point in the history
[ Upstream commit 555238d ]

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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Evan Quan authored and gregkh committed Jun 14, 2022
1 parent 1e29d82 commit a610cfe
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions drivers/gpu/drm/amd/amdgpu/kv_dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1609,19 +1609,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)
Expand Down

0 comments on commit a610cfe

Please sign in to comment.