Skip to contentSkip to conversation

drm/amd/pm: Remove unnecessary cast

PATCH Applied Alex Dewar 2 participants 2 messages Aug 20, 2020

Subsystems (3)
lore
Share & tools
lore

Alex Dewar

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Remove unnecessary cast

In init_powerplay_table_information() the value returned from kmalloc() is cast unnecessarily. Remove cast.

Issue identified with Coccinelle.

---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +1 -1
index 195d8539fbb4..740e2fc7a034 100644
@@ -252,7 +252,7 @@ static int init_powerplay_table_information(
 	phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_max, powerplay_table->PowerSavingClockMax, ATOM_VEGA12_PPCLOCK_COUNT);
 	phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_min, powerplay_table->PowerSavingClockMin, ATOM_VEGA12_PPCLOCK_COUNT);
 
-	pptable_information->smc_pptable = (PPTable_t *)kmalloc(sizeof(PPTable_t), GFP_KERNEL);
+	pptable_information->smc_pptable = kmalloc(sizeof(PPTable_t), GFP_KERNEL);
 	if (pptable_information->smc_pptable == NULL)
 		return -ENOMEM;
 
Signature · 1 line
2.28.0
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 27 lines · Alex Dewar

In init_powerplay_table_information() the value returned from kmalloc() is cast unnecessarily. Remove cast.

Issue identified with Coccinelle.

---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +1 -2
index 195d8539fbb4..740e2fc7a034 100644
@@ -252,7 +252,7 @@ static int init_powerplay_table_information(
        phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_max, powerplay_table->PowerSavingClockMax, ATOM_VEGA12_PPCLOCK_COUNT);
        phm_copy_clock_limits_array(hwmgr, &pptable_information->power_saving_clock_min, powerplay_table->PowerSavingClockMin, ATOM_VEGA12_PPCLOCK_COUNT);
 
-       pptable_information->smc_pptable = (PPTable_t *)kmalloc(sizeof(PPTable_t), GFP_KERNEL);
+       pptable_information->smc_pptable = kmalloc(sizeof(PPTable_t), GFP_KERNEL);
        if (pptable_information->smc_pptable == NULL)
                return -ENOMEM;
 
--

2.28.0

Quoted 4 lines

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

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