mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: ops: fix pointer types to be big-endian
@ 2026-01-06 22:58 Ben Dooks
  2026-01-07 19:02 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2026-01-06 22:58 UTC (permalink / raw)
  To: linux-sound; +Cc: lgirdwood, broonie, linux-kernel, Ben Dooks

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>
---
 sound/soc/soc-ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index 624e9269fc25..ba42939d5f01 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -543,11 +543,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
 			ucontrol->value.bytes.data[0] &= ~params->mask;
 			break;
 		case 2:
-			((u16 *)(&ucontrol->value.bytes.data))[0]
+			((__be16 *)(&ucontrol->value.bytes.data))[0]
 				&= cpu_to_be16(~params->mask);
 			break;
 		case 4:
-			((u32 *)(&ucontrol->value.bytes.data))[0]
+			((__be32 *)(&ucontrol->value.bytes.data))[0]
 				&= cpu_to_be32(~params->mask);
 			break;
 		default:
-- 
2.37.2.352.g3c44437643


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-07 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-06 22:58 [PATCH] ASoC: ops: fix pointer types to be big-endian Ben Dooks
2026-01-07 19:02 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®