Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: ops: improve snd_soc_get_volsw

* clamp the values if the register value read is
out of range

Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
[This patch originally had two changes in it, I removed a second buggy
one -- broonie]
--
v5:
- remove clamp parameter
- move the boundary check after sign-bit extension
Link: https://patch.msgid.link/20250912083624.804-1-niranjan.hy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Niranjan H Y and committed by
Mark Brown
a0ce874c 5998f0d0

+1
+1
sound/soc/soc-ops.c
··· 118 118 if (mc->sign_bit) 119 119 val = sign_extend32(val, mc->sign_bit); 120 120 121 + val = clamp(val, mc->min, mc->max); 121 122 val -= mc->min; 122 123 123 124 if (mc->invert)