Skip to content

Commit 0ab0709

Browse files
gt82leebroonie
authored andcommitted
ASoC: fix regwmask
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>
1 parent a91ab65 commit 0ab0709

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/soc-ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
825825
unsigned int regbase = mc->regbase;
826826
unsigned int regcount = mc->regcount;
827827
unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
828-
unsigned int regwmask = (1<<regwshift)-1;
828+
unsigned int regwmask = (1UL<<regwshift)-1;
829829
unsigned int invert = mc->invert;
830830
unsigned long mask = (1UL<<mc->nbits)-1;
831831
long min = mc->min;
@@ -874,7 +874,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
874874
unsigned int regbase = mc->regbase;
875875
unsigned int regcount = mc->regcount;
876876
unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
877-
unsigned int regwmask = (1<<regwshift)-1;
877+
unsigned int regwmask = (1UL<<regwshift)-1;
878878
unsigned int invert = mc->invert;
879879
unsigned long mask = (1UL<<mc->nbits)-1;
880880
long max = mc->max;

0 commit comments

Comments
 (0)