lkml.org 
[lkml]   [2021]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH linux-next] drm: drop unneeded assignment in the fx_v6_0_enable_mgcg()
From
Date
Hi,

Le 21/08/2021 à 04:08, CGEL a écrit :
> From: Luo penghao <luo.penghao@zte.com.cn>
>
> The first assignment is not used. In order to keep the code style
> consistency of the whole file, the first 'data' assignment should be
> deleted.
>
> The clang_analyzer complains as follows:
>
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:2608:10: warning:
> Although the value storedto 'offset' is used in the enclosing expression,
> the value is never actually read from 'offset'.

Apparently clang only spotted on place, at line 2608.

>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Luo penghao <luo.penghao@zte.com.cn>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> index 6a8dade..84a5f22 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> @@ -2605,7 +2605,7 @@ static void gfx_v6_0_enable_mgcg(struct amdgpu_device *adev, bool enable)
> u32 data, orig, tmp = 0;
>
> if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_MGCG)) {
> - orig = data = RREG32(mmCGTS_SM_CTRL_REG);
> + orig = RREG32(mmCGTS_SM_CTRL_REG);
> data = 0x96940200;
> if (orig != data)
> WREG32(mmCGTS_SM_CTRL_REG, data);
> @@ -2617,7 +2617,7 @@ static void gfx_v6_0_enable_mgcg(struct amdgpu_device *adev, bool enable)
> WREG32(mmCP_MEM_SLP_CNTL, data);
> }
>
> - orig = data = RREG32(mmRLC_CGTT_MGCG_OVERRIDE);
> + orig = RREG32(mmRLC_CGTT_MGCG_OVERRIDE);
> data &= 0xffffffc0;
^^
but you also change here where it is used.

> if (orig != data)
> WREG32(mmRLC_CGTT_MGCG_OVERRIDE, data);
>

CJ

\
 
 \ /
  Last update: 2021-08-21 06:53    [W:1.839 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site