Files
android_kernel_xiaomi_sm8450/drivers/gpu/drm/amd/amdgpu
Nathan Chancellor 931971280c drm/amdgpu: Remove unnecessary variable shadow 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.

shadow is only assigned in one condition and used as the condition for
another if statement; combine the two if statements and remove shadow
to make the code cleaner and resolve this warning.

Fixes: 2e0cc4d48b ("drm/amdgpu: revise RLCG access path")
Link: https://github.com/ClangBuiltLinux/linux/issues/936
Suggested-by: Joe Perches <joe@perches.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2020-03-19 00:03:05 -04:00
..
2019-09-16 09:59:21 -05:00
2020-01-16 13:35:10 -05:00
2019-06-20 11:36:22 -05:00
2020-03-19 00:03:05 -04:00
2020-03-19 00:03:05 -04:00
2020-03-19 00:03:05 -04:00
2017-10-20 13:28:44 -04:00
2020-03-16 16:17:55 -04:00
2019-06-10 23:00:01 +02:00
2020-03-09 13:51:48 -04:00
2020-03-06 14:34:49 -05:00
2019-06-20 21:16:38 -05:00
2020-03-19 00:03:05 -04:00
2020-03-19 00:03:05 -04:00
2016-08-31 15:21:09 -04:00
2020-03-16 16:17:55 -04:00