• Tim Gardner's avatar
    ASoC: adau1373: adau1373_hw_params: Silence overflow warning · 14a1b8ca
    Tim Gardner authored
    ADAU1373_BCLKDIV_SOURCE is defined as BIT(5) which uses UL constants. On
    amd64 the result of the ones complement operator is then truncated to
    unsigned int according to the prototype of snd_soc_update_bits(). I think
    gcc is correctly warning that the upper 32 bits are lost.
    
    sound/soc/codecs/adau1373.c: In function 'adau1373_hw_params':
    sound/soc/codecs/adau1373.c:940:3: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    
    gcc version 4.6.3
    
    Add 2 more BCLKDIV mask macros as explained by Lars:
    
    The BCLKDIV has three fields. The bitclock divider (bit 0-1), the samplerate
    (bit 2-4) and the source select (bit 5). Here we want to update the bitclock
    divider field and the samplerate field. When I wrote the code I was lazy and
    used ~ADAU1373_BCLKDIV_SOURCE as the mask, which for this register is
    functionally equivalent to ADAU1373_BCLKDIV_SR_MASK | ADAU1373_BCLKDIV_BCLK_MASK.
    Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
    Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    14a1b8ca
adau1373.c 46.2 KB