2020-03-17 11:58:12

by Qiujun Huang

[permalink] [raw]
Subject: [PATCH] drm/amd/powerplay: remove redundant check in smu_set_soft_freq_range

min(max) is type of uint32_t, min < 0(max < 0) is never true.
move it.

Addressed-Coverity: ("Unsigned compared against 0")
Signed-off-by: Qiujun Huang <[email protected]>
---
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 96e81c7bc266..fdaea0cc2828 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -222,9 +222,6 @@ int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
{
int ret = 0;

- if (min < 0 && max < 0)
- return -EINVAL;
-
if (!smu_clk_dpm_is_enabled(smu, clk_type))
return 0;

--
2.17.1