Skip to content

Commit cba4590

Browse files
nathanchancebroonie
authored andcommitted
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: ClangBuiltLinux#1952 Fixes: 8ade6cc ("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>
1 parent 1a3b7ea commit cba4590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/codecs/aw88399.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static int aw_dev_set_vcalb(struct aw88399 *aw88399)
438438
if (ret)
439439
return ret;
440440

441-
vsense_select = vsense_select & (~AW88399_VDSEL_MASK);
441+
vsense_select = vsense_value & (~AW88399_VDSEL_MASK);
442442

443443
ret = aw88399_dev_get_icalk(aw88399, &icalk);
444444
if (ret) {

0 commit comments

Comments
 (0)