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

* Re: [PATCH] ASoC: ops: fix pointer types to be big-endian
  2026-01-06 22:58 [PATCH] ASoC: ops: fix pointer types to be big-endian Ben Dooks
@ 2026-01-07 19:02 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-01-07 19:02 UTC (permalink / raw)
  To: linux-sound, Ben Dooks; +Cc: lgirdwood, linux-kernel

On Tue, 06 Jan 2026 22:58:46 +0000, Ben Dooks wrote:
> 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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: ops: fix pointer types to be big-endian
      commit: 2fa0eaf78c4bb24c2b05a4db3e0d86a7dcd8fd9f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ 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®