]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: fix regwmask
author이경택 <gt82.lee@samsung.com>
Mon, 30 Mar 2020 07:35:59 +0000 (16:35 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:06 +0000 (10:50 +0200)
commit 835347e1222f3da86d3c07a4dc3827e200231ef4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-ops.c

index f4dc3d445aae9e128e2db6f85fac603c943398f1..95fc24580f85f9dc9ee5b8938e1be8816f1b39cd 100644 (file)
@@ -832,7 +832,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;
@@ -881,7 +881,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;