]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: codecs: msm8916: fix invalid cast to bool type
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 2 May 2017 13:33:01 +0000 (22:33 +0900)
committerMark Brown <broonie@kernel.org>
Sun, 14 May 2017 09:58:03 +0000 (18:58 +0900)
commit60bcee4f3b4858006ec24d3176e0bf309f6a3e9a
tree83402f9ac8ff7407377e0b9c3f7fd264e7fa969f
parent81e0e7134ab085ac5d0890177bfed38a0f2be4f8
ASoC: codecs: msm8916: fix invalid cast to bool type

A function snd_soc_update_bits() is an application of
regmap_update_bits_base(). This function takes some arguments for bitmask
and new value, thus the arguments should be a type which has width.
However bool is used to variable for the argument. This brings truncation
and results in invalid operation.

This commit fixes this bug by using unsigned int type, instead of bool.
This bug is detected by sparse:

smsm8916-wcd-analog.c:809:43: warning: odd constant _Bool cast (40 becomes 1)
smsm8916-wcd-analog.c:814:43: warning: odd constant _Bool cast (40 becomes 1)

Fixes: 1e90dab1850e ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/msm8916-wcd-analog.c