Skip to contentSkip to conversation

drm/amd/pm: simplify the return expression of smu_hw_fini

PATCH Applied Liu Shixin 2 participants 2 messages Sep 21, 2020

Subsystems (3)
lore
Share & tools
lore

Liu Shixin

author
#0 lore raw

PATCH 1/1 drm/amd/pm: simplify the return expression of smu_hw_fini

Simplify the return expression.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -6
index 5c4b74f964fc..3612841d40dc 100644
@@ -1214,7 +1214,6 @@ static int smu_hw_fini(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct smu_context *smu = &adev->smu;
-	int ret = 0;
 
 	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
@@ -1230,11 +1229,7 @@ static int smu_hw_fini(void *handle)
 
 	adev->pm.dpm_enabled = false;
 
-	ret = smu_smc_hw_cleanup(smu);
-	if (ret)
-		return ret;
-
-	return 0;
+	return smu_smc_hw_cleanup(smu);
 }
 
 int smu_reset(struct smu_context *smu)
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 40 lines · Liu Shixin

Simplify the return expression.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -7
index 5c4b74f964fc..3612841d40dc 100644
@@ -1214,7 +1214,6 @@ static int smu_hw_fini(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct smu_context *smu = &adev->smu;
-       int ret = 0;
 
        if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
                return 0;
@@ -1230,11 +1229,7 @@ static int smu_hw_fini(void *handle)
 
        adev->pm.dpm_enabled = false;
 
-       ret = smu_smc_hw_cleanup(smu);
-       if (ret)
-               return ret;
-
-       return 0;
+       return smu_smc_hw_cleanup(smu);
 }
 
 int smu_reset(struct smu_context *smu)
--

2.25.1

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