]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: fix regwmask
author이경택 <gt82.lee@samsung.com>
Mon, 30 Mar 2020 07:35:59 +0000 (16:35 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 30 Mar 2020 17:22:36 +0000 (18:22 +0100)
If regwshift is 32 and the selected architecture compiles '<<' operator
for signed int literal into rotating shift, '1<<regwshift' became 1 and
it makes regwmask to 0x0.
The literal is set to unsigned long to get intended regwmask.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/001001d60665$db7af3e0$9270dba0$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c

index 652657dc68093279a337d74737aeaccf30fa3826..55ffb34be95e1b1020dc684aac0eaa6f587ffed4 100644 (file)
@@ -825,7 +825,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
        unsigned int regbase = mc->regbase;
        unsigned int regcount = mc->regcount;
        unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
-       unsigned int regwmask = (1<<regwshift)-1;
+       unsigned int regwmask = (1UL<<regwshift)-1;
        unsigned int invert = mc->invert;
        unsigned long mask = (1UL<<mc->nbits)-1;
        long min = mc->min;
@@ -874,7 +874,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
        unsigned int regbase = mc->regbase;
        unsigned int regcount = mc->regcount;
        unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
-       unsigned int regwmask = (1<<regwshift)-1;
+       unsigned int regwmask = (1UL<<regwshift)-1;
        unsigned int invert = mc->invert;
        unsigned long mask = (1UL<<mc->nbits)-1;
        long max = mc->max;