]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: avoid uninitialized variable warning
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Dec 2020 23:41:13 +0000 (15:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Dec 2020 23:41:13 +0000 (15:41 -0800)
commit0c986cf34f6c8434b41e2874c7bd8ab96d46aa5a
tree1a0ddc065828cc2d1de6abd3396bb44e41b25b50
parente0043e81efb96cbc70b7a7685a586f8ee41129a0
drm/amd/display: avoid uninitialized variable warning

clang (quite rightly) complains fairly loudly about the newly added
mpc1_get_mpc_out_mux() function returning an uninitialized value if the
'opp_id' checks don't pass.

This may not happen in practice, but the code really shouldn't return
garbage if the sanity checks don't pass.

So just initialize 'val' to zero to avoid the issue.

Fixes: 35c4abb1fe52 ("drm/amd/display: add getter routine to retrieve mpcc mux")
Cc: Josip Pavic <Josip.Pavic@amd.com>
Cc: Bindu Ramamurthy <bindu.r@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c