smu_set_power_limit() will call set_power_limit() if the limit type
isn't default ppt, but after a bound check will call set_power_limit()
regardless.

The first callpath is not necessary, remove it and do the bounds check
for all calls.

Cc: Lijo Lazar <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index ac99bb7e2e7b..431333060b72 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -2939,10 +2939,6 @@ static int smu_set_power_limit(void *handle, uint32_t 
limit)
                return -EOPNOTSUPP;
 
        limit &= (1<<24)-1;
-       if (limit_type != SMU_DEFAULT_PPT_LIMIT)
-               if (smu->ppt_funcs->set_power_limit)
-                       return smu->ppt_funcs->set_power_limit(smu, limit_type, 
limit);
-
        if ((limit > smu->max_power_limit) || (limit < smu->min_power_limit)) {
                dev_err(smu->adev->dev,
                        "New power limit (%d) is out of range [%d,%d]\n",
-- 
2.51.0

Reply via email to