Re: [PATCH 2/2] drm/amdgpu: remove unnecessary judgement in sdma reg offest calculaton

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Series is:
Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

On Fri, Sep 30, 2022 at 2:17 AM Yifan Zhang <yifan1.zhang@xxxxxxx> wrote:
>
> clean sdma_v6_0_get_reg_offset function.
>
> Signed-off-by: Yifan Zhang <yifan1.zhang@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index db51230163c5..b2c71f533e93 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -67,12 +67,10 @@ static u32 sdma_v6_0_get_reg_offset(struct amdgpu_device *adev, u32 instance, u3
>         if (internal_offset >= SDMA0_HYP_DEC_REG_START &&
>             internal_offset <= SDMA0_HYP_DEC_REG_END) {
>                 base = adev->reg_offset[GC_HWIP][0][1];
> -               if (instance != 0)
> -                       internal_offset += SDMA1_HYP_DEC_REG_OFFSET * instance;
> +               internal_offset += SDMA1_HYP_DEC_REG_OFFSET * instance;
>         } else {
>                 base = adev->reg_offset[GC_HWIP][0][0];
> -               if (instance == 1)
> -                       internal_offset += SDMA1_REG_OFFSET;
> +               internal_offset += SDMA1_REG_OFFSET * instance;
>         }
>
>         return base + internal_offset;
> --
> 2.37.3
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux