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: codecs: lpass-wsa-macro: remove unnecessary bounds check

WSA_MACRO_RX0 is 0 and WSA_MACRO_RX_MIX1 is (WSA_MACRO_RX_MAX-1), which
means it is not possible for the bounds check to fail.

Removing the WSA_MACRO_RX_MIX1 limit is needed to add support for other
ports (RX4, RX5, etc.), in which case the valid range depends on the HW
version: rely on the driver only setting valid ports in active_ch_mask
instead (already the case).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251117051523.16462-1-jonathan@marek.ca
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jonathan Marek and committed by
Mark Brown
38fc5add e2c48498

-11
-11
sound/soc/codecs/lpass-wsa-macro.c
··· 1168 1168 1169 1169 for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) { 1170 1170 int_1_mix1_inp = port; 1171 - if ((int_1_mix1_inp < WSA_MACRO_RX0) || (int_1_mix1_inp > WSA_MACRO_RX_MIX1)) { 1172 - dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n", 1173 - __func__, dai->id); 1174 - return -EINVAL; 1175 - } 1176 - 1177 1171 int_mux_cfg0 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG0; 1178 1172 1179 1173 /* ··· 1214 1220 1215 1221 for_each_set_bit(port, &wsa->active_ch_mask[dai->id], WSA_MACRO_RX_MAX) { 1216 1222 int_2_inp = port; 1217 - if ((int_2_inp < WSA_MACRO_RX0) || (int_2_inp > WSA_MACRO_RX_MIX1)) { 1218 - dev_err(component->dev, "%s: Invalid RX port, Dai ID is %d\n", 1219 - __func__, dai->id); 1220 - return -EINVAL; 1221 - } 1222 1223 1223 1224 int_mux_cfg1 = CDC_WSA_RX_INP_MUX_RX_INT0_CFG1; 1224 1225 for (j = 0; j < NUM_INTERPOLATORS; j++) {