Skip to contentSkip to conversation

drm/amd/pm: Remove the unneeded result variable

PATCH Applied [email protected] 2 participants 2 messages Sep 20, 2022

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

PATCH 1/1 drm/amd/pm: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value append_vbios_pptable() directly instead of storing it in another redundant variable.

---
 .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +1 -4
index 1e79baab753e..bd54fbd393b9 100644
@@ -195,7 +195,6 @@ static int init_powerplay_table_information(
 	struct phm_ppt_v3_information *pptable_information =
 		(struct phm_ppt_v3_information *)hwmgr->pptable;
 	uint32_t disable_power_control = 0;
-	int result;
 
 	hwmgr->thermal_controller.ucType = powerplay_table->ucThermalControllerType;
 	pptable_information->uc_thermal_controller_type = powerplay_table->ucThermalControllerType;
@@ -257,9 +256,7 @@ static int init_powerplay_table_information(
 	if (pptable_information->smc_pptable == NULL)
 		return -ENOMEM;
 
-	result = append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
-
-	return result;
+	return append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
 }
 
 static int vega12_pp_tables_initialize(struct pp_hwmgr *hwmgr)
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks.

Quoted 37 lines · On Tue, Sep 20, 2022 at 2:35 AM <[email protected]> wrote:

From: ye xingchen <[email protected]>

Return the value append_vbios_pptable() directly instead of storing it in another redundant variable.

---
 .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +1 -5
index 1e79baab753e..bd54fbd393b9 100644
@@ -195,7 +195,6 @@ static int init_powerplay_table_information(
        struct phm_ppt_v3_information *pptable_information =
                (struct phm_ppt_v3_information *)hwmgr->pptable;
        uint32_t disable_power_control = 0;
-       int result;
 
        hwmgr->thermal_controller.ucType = powerplay_table->ucThermalControllerType;
        pptable_information->uc_thermal_controller_type = powerplay_table->ucThermalControllerType;
@@ -257,9 +256,7 @@ static int init_powerplay_table_information(
        if (pptable_information->smc_pptable == NULL)
                return -ENOMEM;
 
-       result = append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
-
-       return result;
+       return append_vbios_pptable(hwmgr, (pptable_information->smc_pptable));
 }
 
 static int vega12_pp_tables_initialize(struct pp_hwmgr *hwmgr)
--

2.25.1