Skip to contentSkip to conversation

drm/amdgpu: Remove the unneeded result variable 'r'

PATCH Applied [email protected] 2 participants 2 messages Aug 30, 2022

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

PATCH 1/1 drm/amdgpu: Remove the unneeded result variable 'r'

From: ye xingchen <[email protected]>

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

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -4
index 65181efba50e..0cf9d3b486b2 100644
@@ -2002,7 +2002,6 @@ static int sdma_v4_0_sw_fini(void *handle)
 
 static int sdma_v4_0_hw_init(void *handle)
 {
-	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
 	if (adev->flags & AMD_IS_APU)
@@ -2011,9 +2010,7 @@ static int sdma_v4_0_hw_init(void *handle)
 	if (!amdgpu_sriov_vf(adev))
 		sdma_v4_0_init_golden_registers(adev);
 
-	r = sdma_v4_0_start(adev);
-
-	return r;
+	return sdma_v4_0_start(adev);
 }
 
 static int sdma_v4_0_hw_fini(void *handle)
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 37 lines · On Tue, Aug 30, 2022 at 4:32 AM <[email protected]> wrote:

From: ye xingchen <[email protected]>

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

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -5
index 65181efba50e..0cf9d3b486b2 100644
@@ -2002,7 +2002,6 @@ static int sdma_v4_0_sw_fini(void *handle)
 
 static int sdma_v4_0_hw_init(void *handle)
 {
-       int r;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
        if (adev->flags & AMD_IS_APU)
@@ -2011,9 +2010,7 @@ static int sdma_v4_0_hw_init(void *handle)
        if (!amdgpu_sriov_vf(adev))
                sdma_v4_0_init_golden_registers(adev);
 
-       r = sdma_v4_0_start(adev);
-
-       return r;
+       return sdma_v4_0_start(adev);
 }
 
 static int sdma_v4_0_hw_fini(void *handle)
--

2.25.1