Skip to content

Commit 2fa0eaf

Browse files
bjdooks-ctbroonie
authored andcommitted
ASoC: ops: fix pointer types to be big-endian
If manipulating big-endian data, make the pointers be big-endian instead of host-endian. This should stop the following sparse warnigns about endian-conversion: sound/soc/soc-ops.c:547:33: warning: invalid assignment: &= sound/soc/soc-ops.c:547:33: left side has type unsigned short sound/soc/soc-ops.c:547:33: right side has type restricted __be16 sound/soc/soc-ops.c:551:33: warning: invalid assignment: &= sound/soc/soc-ops.c:551:33: left side has type unsigned int sound/soc/soc-ops.c:551:33: right side has type restricted __be32 Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Link: https://patch.msgid.link/20260106225846.83580-1-ben.dooks@codethink.co.uk Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f33db67 commit 2fa0eaf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/soc-ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
543543
ucontrol->value.bytes.data[0] &= ~params->mask;
544544
break;
545545
case 2:
546-
((u16 *)(&ucontrol->value.bytes.data))[0]
546+
((__be16 *)(&ucontrol->value.bytes.data))[0]
547547
&= cpu_to_be16(~params->mask);
548548
break;
549549
case 4:
550-
((u32 *)(&ucontrol->value.bytes.data))[0]
550+
((__be32 *)(&ucontrol->value.bytes.data))[0]
551551
&= cpu_to_be32(~params->mask);
552552
break;
553553
default:

0 commit comments

Comments
 (0)