2022-08-26 08:25:43

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] drm/amdgpu: Remove the unneeded result variable

From: ye xingchen <[email protected]>

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

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index 83c6ccaaa9e4..95689ef4be10 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -1413,12 +1413,9 @@ static int sdma_v5_2_sw_fini(void *handle)

static int sdma_v5_2_hw_init(void *handle)
{
- int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

- r = sdma_v5_2_start(adev);
-
- return r;
+ return sdma_v5_2_start(adev);
}

static int sdma_v5_2_hw_fini(void *handle)
--
2.25.1


2022-08-26 21:04:47

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH linux-next] drm/amdgpu: Remove the unneeded result variable

Applied. Thanks!

Alex

On Fri, Aug 26, 2022 at 3:24 AM <[email protected]> wrote:
>
> From: ye xingchen <[email protected]>
>
> Return the value sdma_v5_2_start() directly instead of storing it in
> another redundant variable.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: ye xingchen <[email protected]>
> ---
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index 83c6ccaaa9e4..95689ef4be10 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -1413,12 +1413,9 @@ static int sdma_v5_2_sw_fini(void *handle)
>
> static int sdma_v5_2_hw_init(void *handle)
> {
> - int r;
> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>
> - r = sdma_v5_2_start(adev);
> -
> - return r;
> + return sdma_v5_2_start(adev);
> }
>
> static int sdma_v5_2_hw_fini(void *handle)
> --
> 2.25.1