drm/amdgpu: Fix uninitialized warning in mmhub_v2_0_get_clockgating()
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix uninitialized warning in mmhub_v2_0_get_clockgating()
Clang warns:
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c:686:3: error: variable 'data' is uninitialized when used here [-Werror,-Wuninitialized]
data |= MM_ATC_L2_MISC_CG__ENABLE_MASK;
^~~~
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c:674:10: note: initialize the variable 'data' to silence this warning
int data, data1;
^
= 01 error generated.
This clearly should have just been a regular '=', as there was no prior assignment.
Fixes 7a4fad619819 ("drm/amdgpu: Remove ATC L2 access for MMHUB 2.1.x")
Signed-off-by Nathan Chancellor <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c +1 -1
@@ -683,7 +683,7 @@ static void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)/* There is no ATCL2 in MMHUB for 2.1.x. Keep the status * based on DAGB */ - data |=MM_ATC_L2_MISC_CG__ENABLE_MASK ; + data =MM_ATC_L2_MISC_CG__ENABLE_MASK ; data1 =RREG32_SOC15 (MMHUB ,0 , mmDAGB0_CNTL_MISC2_Sienna_Cichlid);break ;default :
base-commit: fb5e487f910e1105019b883e8ed25e36e4bfd657
Signature · 1 line
2.38.1
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 40 lines · Nathan Chancellor
Clang warns:
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c:686:3: error: variable 'data' is uninitialized when used here [-Werror,-Wuninitialized]data |= MM_ATC_L2_MISC_CG__ENABLE_MASK; ^~~~ drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c:674:10: note: initialize the variable 'data' to silence this warning int data, data1; ^ = 01 error generated.
This clearly should have just been a regular '=', as there was no prior assignment.
Fixes 7a4fad619819 ("drm/amdgpu: Remove ATC L2 access for MMHUB 2.1.x")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c +1
-1@@ -683,7 +683,7 @@ static void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)/* There is no ATCL2 in MMHUB for 2.1.x. Keep the status * based on DAGB */ - data |=MM_ATC_L2_MISC_CG__ENABLE_MASK ; + data =MM_ATC_L2_MISC_CG__ENABLE_MASK ; data1 =RREG32_SOC15 (MMHUB ,0 , mmDAGB0_CNTL_MISC2_Sienna_Cichlid);break ;default :base-commit:
fb5e487f910e1105019b883e8ed25e36e4bfd657--
2.38.1