summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2023-10-27 09:54:25 -0700
committerMark Brown <broonie@kernel.org>2023-10-30 17:39:12 +0000
commitcba4590036855f4e3110d43c14385d2401080dbb (patch)
tree80e1501d2dfdbc35bdfd5bf0666178fcfcb9f826 /sound
parent1a3b7eab8500a6b923f7b62cc8aa4d832c7dfb3e (diff)
ASoC: codecs: aw88399: Fix -Wuninitialized in aw_dev_set_vcalb()
Clang warns (or errors with CONFIG_WERROR=y): sound/soc/codecs/aw88399.c:441:18: error: variable 'vsense_select' is uninitialized when used here [-Werror,-Wuninitialized] 441 | vsense_select = vsense_select & (~AW88399_VDSEL_MASK); | ^~~~~~~~~~~~~ sound/soc/codecs/aw88399.c:431:28: note: initialize the variable 'vsense_select' to silence this warning 431 | unsigned int vsense_select, vsense_value; | ^ | = 0 1 error generated. This clearly should have been using the value received from regmap_read(). Use the correct variable to resolve the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1952 Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Weidong Wang <wangweidong.a@awinic.com> Link: https://lore.kernel.org/r/20231027-asoc-aw88399-fix-wuninitialized-v1-1-b1044493e4cd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/aw88399.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c
index ce30bc7cdea9..47fe38d0def5 100644
--- a/sound/soc/codecs/aw88399.c
+++ b/sound/soc/codecs/aw88399.c
@@ -438,7 +438,7 @@ static int aw_dev_set_vcalb(struct aw88399 *aw88399)
if (ret)
return ret;
- vsense_select = vsense_select & (~AW88399_VDSEL_MASK);
+ vsense_select = vsense_value & (~AW88399_VDSEL_MASK);
ret = aw88399_dev_get_icalk(aw88399, &icalk);
if (ret) {