Skip to contentSkip to conversation

drm/amd/powerplay: fix compile warning for wrong data type V2

PATCH In review Evan Quan 2 participants 2 messages Sep 5, 2018 – Sep 6, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix compile warning for wrong data type V2

do_div expects the 1st argument in 64bit instead of 32bit. Drop the usage of do_div as it seems unnecessary.

V2: drop usage of do_div completely

Change-Id Id2032a43727e7f1fa5163333d3565354d412a561
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +2 -2
index 3efd59e984a3..1e65ac01e0f5 100644
@@ -1195,7 +1195,7 @@ static int vega20_set_sclk_od(
 	int ret = 0;
 
 	od_sclk = golden_sclk_table->dpm_levels[golden_sclk_table->count - 1].value * value;
-	do_div(od_sclk, 100);
+	od_sclk /= 100;
 	od_sclk += golden_sclk_table->dpm_levels[golden_sclk_table->count - 1].value;
 
 	ret = vega20_od8_set_settings(hwmgr, OD8_SETTING_GFXCLK_FMAX, od_sclk);
@@ -1242,7 +1242,7 @@ static int vega20_set_mclk_od(
 	int ret = 0;
 
 	od_mclk = golden_mclk_table->dpm_levels[golden_mclk_table->count - 1].value * value;
-	do_div(od_mclk, 100);
+	od_mclk /= 100;
 	od_mclk += golden_mclk_table->dpm_levels[golden_mclk_table->count - 1].value;
 
 	ret = vega20_od8_set_settings(hwmgr, OD8_SETTING_UCLK_FMAX, od_mclk);
Signature · 6 lines
2.18.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by Alex Deucher
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Wednesday, September 5, 2018 1:19 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: fix compile warning for wrong data type V2

Quoted 7 lines

do_div expects the 1st argument in 64bit instead of 32bit. Drop the usage of do_div as it seems unnecessary.

V2: drop usage of do_div completely

Change-Id Id2032a43727e7f1fa5163333d3565354d412a561
Quoted 36 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -2
index 3efd59e984a3..1e65ac01e0f5 100644
@@ -1195,7 +1195,7 @@ static int vega20_set_sclk_od(
 	int ret = 0;
 
 	od_sclk = golden_sclk_table->dpm_levels[golden_sclk_table->count
- 1].value * value;
-	do_div(od_sclk, 100);
+	od_sclk /= 100;
 	od_sclk += golden_sclk_table->dpm_levels[golden_sclk_table-
 >count - 1].value;
 
 	ret = vega20_od8_set_settings(hwmgr,

OD8_SETTING_GFXCLK_FMAX, od_sclk); @@ -1242,7 +1242,7 @@ static int vega20_set_mclk_od(

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +0 -0
 	int ret = 0;
 
 	od_mclk = golden_mclk_table->dpm_levels[golden_mclk_table-
Quoted 1 line

count - 1].value * value;

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -1
-	do_div(od_mclk, 100);
+	od_mclk /= 100;
 	od_mclk += golden_mclk_table->dpm_levels[golden_mclk_table-
Quoted 1 line

count - 1].value;

ret = vega20_od8_set_settings(hwmgr, OD8_SETTING_UCLK_FMAX,
od_mclk);
--
2.18.0

Quoted 4 lines

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

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