[PATCH] drm/amdgpu: simplify the return expression of vega10_ih_hw_init()

cgel.zte@gmail.com posted 1 patch 4 years ago
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
[PATCH] drm/amdgpu: simplify the return expression of vega10_ih_hw_init()
Posted by cgel.zte@gmail.com 4 years ago
From: Minghao Chi <chi.minghao@zte.com.cn>

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index 3070466f54e1..cdd599a08125 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -521,14 +521,9 @@ static int vega10_ih_sw_fini(void *handle)
 
 static int vega10_ih_hw_init(void *handle)
 {
-	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-	r = vega10_ih_irq_init(adev);
-	if (r)
-		return r;
-
-	return 0;
+	return vega10_ih_irq_init(adev);
 }
 
 static int vega10_ih_hw_fini(void *handle)
-- 
2.25.1
Re: [PATCH] drm/amdgpu: simplify the return expression of vega10_ih_hw_init()
Posted by Alex Deucher 4 years ago
Applied.  Thanks!

Alex

On Wed, May 4, 2022 at 10:22 PM <cgel.zte@gmail.com> wrote:
>
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Simplify the return expression.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index 3070466f54e1..cdd599a08125 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -521,14 +521,9 @@ static int vega10_ih_sw_fini(void *handle)
>
>  static int vega10_ih_hw_init(void *handle)
>  {
> -       int r;
>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>
> -       r = vega10_ih_irq_init(adev);
> -       if (r)
> -               return r;
> -
> -       return 0;
> +       return vega10_ih_irq_init(adev);
>  }
>
>  static int vega10_ih_hw_fini(void *handle)
> --
> 2.25.1
>
>