Skip to contentSkip to conversation

drm/amd/powerplay: fix the coverity warning about negative check for an unsigned value

PATCH In review Prike Liang 2 participants 2 messages Mar 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix the coverity warning about negative check for an unsigned value

There will be a coverity warning because min and max are both unsigned.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -3
index d454493..f18e3fa 100644
@@ -214,9 +214,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;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, March 10, 2020 8:36 AM
To: [email protected]; Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Liang, Prike <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix the coverity warning about negative check for an unsigned value

There will be a coverity warning because min and max are both unsigned.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -4
index d454493..f18e3fa 100644
@@ -214,9 +214,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.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx