• Takashi Sakamoto's avatar
    ASoC: codecs: msm8916: fix invalid cast to bool type · 9f3b777f
    Takashi Sakamoto authored
    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: 585e881e ("ASoC: codecs: Add msm8916-wcd analog codec")
    Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    9f3b777f
msm8916-wcd-analog.c 28.1 KB