Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/amdgpu: Initialize shadow to false in gfx_v9_0_rlcg_wreg
clang warns: drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:754:6: warning: variable 'shadow' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (offset == grbm_cntl || offset == grbm_idx) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:757:6: note: uninitialized use occurs here if (shadow) { ^~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:754:2: note: remove the 'if' if its condition is always true if (offset == grbm_cntl || offset == grbm_idx) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:738:13: note: initialize the variable 'shadow' to silence this warning bool shadow; ^ = 0 1 warning generated. It is not wrong so initialize shadow to false to ensure shadow is always used initialized. Fixes: 2e0cc4d ("drm/amdgpu: revise RLCG access path") Link: ClangBuiltLinux#936 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
- Loading branch information