Skip to contentSkip to conversation

drm/amdgpu/powerplay: fix warning in smu_v11_0.c

PATCH In review Alex Deucher 2 participants 2 messages Jan 9, 2020 – Jan 10, 2020

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

PATCH 1/1 drm/amdgpu/powerplay: fix warning in smu_v11_0.c

Cast to make min() happy. The values are well within range.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -1
index 76bddd582c60..02f8c9cb89d9 100644
@@ -1159,7 +1159,7 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu,
 
 	low = max(SMU_THERMAL_MINIMUM_ALERT_TEMP,
 			range.min / SMU_TEMPERATURE_UNITS_PER_CENTIGRADES);
-	high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP, powerplay_table->software_shutdown_temp);
+	high = min((uint16_t)SMU_THERMAL_MAXIMUM_ALERT_TEMP, powerplay_table->software_shutdown_temp);
 
 	if (low > high)
 		return -EINVAL;
Signature · 6 lines
2.24.1

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

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, January 10, 2020 4:45 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/powerplay: fix warning in smu_v11_0.c

Cast to make min() happy. The values are well within range.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -1
index 76bddd582c60..02f8c9cb89d9 100644
@@ -1159,7 +1159,7 @@ static int smu_v11_0_set_thermal_range(struct
 smu_context *smu,
 
 	low = max(SMU_THERMAL_MINIMUM_ALERT_TEMP,
 			range.min /
 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES);
-	high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP,
 powerplay_table->software_shutdown_temp);
+	high = min((uint16_t)SMU_THERMAL_MAXIMUM_ALERT_TEMP,

powerplay_table->software_shutdown_temp);

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +0 -1
 	if (low > high)
 		return -EINVAL;
--

2.24.1

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C4672d7f3341f44a41fa 608d79544cd4e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6371 41995209778022&amp;sdata=TRtFdbV9rFibTHYzbpeFqo8nxMYMi%2Fk9mikRTf yDwaM%3D&amp;reserved=0

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