Skip to contentSkip to conversation

drm/amd/powerplay: delete some dead code

PATCH In review Dan Carpenter 2 participants 2 messages Mar 21, 2019

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

PATCH 1/1 drm/amd/powerplay: delete some dead code

The "size" variable is unsigned. We never pass invalid sizes to this function and we already used it as an array offset earlier so it's too late to check here.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -3
index 17143888e37e..b602975563fc 100644
@@ -1668,9 +1668,6 @@ static int smu_v11_0_set_power_profile_mode(struct smu_context *smu, long *input
 	}
 
 	if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-		if (size < 0)
-			return -EINVAL;
-
 		ret = smu_v11_0_get_activity_monitor_coeff(smu,
 							   (uint8_t *)(&activity_monitor),
 							   WORKLOAD_PPLIB_CUSTOM_BIT);
Signature · 6 lines
2.17.1

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

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, March 21, 2019 2:27 PM
To: Deucher, Alexander <[email protected]>
Cc: Koenig, Christian <[email protected]>; Zhou, David(ChunMing) <[email protected]>; David Airlie <[email protected]>; Daniel Vetter <[email protected]>; Huang, Ray <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Gao, Likun <[email protected]>; Gui, Jack <[email protected]>; [email protected]; kernel- [email protected]
Subject: [PATCH] drm/amd/powerplay: delete some dead code

Quoted 4 lines

The "size" variable is unsigned. We never pass invalid sizes to this function and we already used it as an array offset earlier so it's too late to check here.

Thanks, will apply it.

Quoted 23 lines
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
index 17143888e37e..b602975563fc 100644
@@ -1668,9 +1668,6 @@ static int

smu_v11_0_set_power_profile_mode(struct smu_context *smu, long *input

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -0
 	}
 
 	if (smu->power_profile_mode ==

PP_SMC_POWER_PROFILE_CUSTOM) {

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -3
-		if (size < 0)
-			return -EINVAL;
-
 		ret = smu_v11_0_get_activity_monitor_coeff(smu,
 							   (uint8_t

*)(&activity_monitor),

Quoted 3 lines

WORKLOAD_PPLIB_CUSTOM_BIT);
--
2.17.1

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