ASoC: mchp-spdifrx: Fix uninitialized use of mr in mchp_spdifrx_hw_params()
authorNathan Chancellor <nathan@kernel.org>
Thu, 2 Feb 2023 16:34:19 +0000 (09:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:28 +0000 (09:39 +0100)
commitfecd236ef6be9570416caa67efdebe5c27e77340
tree1feba42256eab11d2ec15f995b0dce2497aa81c3
parent2b346cc075ecd80c297b9b0b60ba76e47c7c4764
ASoC: mchp-spdifrx: Fix uninitialized use of mr in mchp_spdifrx_hw_params()

[ Upstream commit 218674a45930c700486d27b765bf2f1b43f8cbf7 ]

Clang warns:

  ../sound/soc/atmel/mchp-spdifrx.c:455:3: error: variable 'mr' is uninitialized when used here [-Werror,-Wuninitialized]
                  mr |= SPDIFRX_MR_ENDIAN_BIG;
                  ^~
  ../sound/soc/atmel/mchp-spdifrx.c:432:8: note: initialize the variable 'mr' to silence this warning
          u32 mr;
                ^
                 = 0
  1 error generated.

Zero initialize mr so that these bitwise OR and assignment operation
works unconditionally.

Fixes: fa09fa60385a ("ASoC: mchp-spdifrx: fix controls which rely on rsr register")
Link: https://github.com/ClangBuiltLinux/linux/issues/1797
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230202-mchp-spdifrx-fix-uninit-mr-v1-1-629a045d7a2f@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/atmel/mchp-spdifrx.c