Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: qcom: Two fixes from Clang warning audit
@ 2026-11-19 17:07 Ian Rogers
  2026-11-19 17:07 ` [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators in HD2 control Ian Rogers
  2026-11-19 17:07 ` [PATCH 2/2] ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA ISR Ian Rogers
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Rogers @ 2026-11-19 17:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, llvm, Elkin Cruz,
	Ian Rogers

Two fixes in Qualcomm ASoC drivers found while auditing Clang
warnings (-Wconditional-uninitialized and -Wassign-enum) on an
x86_64 allyesconfig build:

1. Return early for non-HPH interpolators in rx_macro_hd2_control().
2. Return IRQ_NONE instead of -EINVAL on an invalid DAI ID in
   lpass_dma_interrupt_handler().

Build-tested with LLVM=1 W=1 (-Werror); not runtime-tested on
Qualcomm audio hardware.

Ian Rogers (2):
  ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators
    in HD2 control
  ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA
    ISR

 sound/soc/codecs/lpass-rx-macro.c | 2 ++
 sound/soc/qcom/lpass-platform.c   | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.56.1.708.g77570a6a1d-goog


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

* [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators in HD2 control
  2026-11-19 17:07 [PATCH 0/2] ASoC: qcom: Two fixes from Clang warning audit Ian Rogers
@ 2026-11-19 17:07 ` Ian Rogers
  2026-11-19 17:07 ` [PATCH 2/2] ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA ISR Ian Rogers
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2026-11-19 17:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, llvm, Elkin Cruz,
	Ian Rogers

rx_macro_enable_interp() invokes rx_macro_hd2_control() whenever
rx->hph_hd2_mode is enabled, including for INTERP_AUX. However,
rx_macro_hd2_control() only assigns hd2_scale_reg and hd2_enable_reg for
INTERP_HPHL and INTERP_HPHR, leaving both u16 register offsets
uninitialized on the stack for INTERP_AUX before testing
'if (hd2_enable_reg && ...)' and writing to random codec register
addresses.

Return immediately in the default branch of switch (interp_idx).

Found via an x86_64 LLVM=1 (Clang 21.1.8) allyesconfig audit with
-Wconditional-uninitialized enabled; fix and changelog drafted with an AI
coding assistant. Build-tested under LLVM=1 W=1 (-Werror) and
-Wconditional-uninitialized; not tested on Qualcomm LPASS audio hardware.

Fixes: 4f692926f562 ("ASoC: codecs: lpass-rx-macro: add dapm widgets and route")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 sound/soc/codecs/lpass-rx-macro.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index ab8a1c2b0489..84a3a47cf932 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -2414,6 +2414,8 @@ static void rx_macro_hd2_control(struct snd_soc_component *component,
 		hd2_scale_reg = CDC_RX_RXn_RX_PATH_SEC3(rx, 1);
 		hd2_enable_reg = CDC_RX_RXn_RX_PATH_CFG0(rx, 1);
 		break;
+	default:
+		return;
 	}
 
 	if (hd2_enable_reg && SND_SOC_DAPM_EVENT_ON(event)) {
-- 
2.56.1.708.g77570a6a1d-goog


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

* [PATCH 2/2] ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA ISR
  2026-11-19 17:07 [PATCH 0/2] ASoC: qcom: Two fixes from Clang warning audit Ian Rogers
  2026-11-19 17:07 ` [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators in HD2 control Ian Rogers
@ 2026-11-19 17:07 ` Ian Rogers
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2026-11-19 17:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, llvm, Elkin Cruz,
	Ian Rogers

In lpass_dma_interrupt_handler(), the default switch branch returns
-EINVAL from an irqreturn_t handler, which triggers report_bad_irq()
in note_interrupt() instead of reporting an unhandled interrupt.

Return IRQ_NONE, matching the other error paths in
lpass_dma_interrupt_handler().

Found via Clang -Wassign-enum on an x86_64 allyesconfig build.
Verified by building sound/soc/qcom/lpass-platform.o with LLVM=1 W=1
(-Werror) and -Wassign-enum; not runtime-tested on Qualcomm LPASS
hardware.

Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 sound/soc/qcom/lpass-platform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index dad4becf7579..45379604b689 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -963,8 +963,9 @@ static irqreturn_t lpass_dma_interrupt_handler(
 		val = 0;
 	break;
 	default:
-	dev_err(soc_runtime->dev, "%s: invalid  %d interface\n", __func__, dai_id);
-	return -EINVAL;
+		dev_err(soc_runtime->dev, "%s: invalid %d interface\n",
+			__func__, dai_id);
+		return IRQ_NONE;
 	}
 	if (interrupts & LPAIF_IRQ_PER(chan)) {
 		rv = regmap_write_bits(map, reg, mask, (LPAIF_IRQ_PER(chan) | val));
-- 
2.56.1.708.g77570a6a1d-goog


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

end of thread, other threads:[~2026-11-19 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 17:07 [PATCH 0/2] ASoC: qcom: Two fixes from Clang warning audit Ian Rogers
2026-11-19 17:07 ` [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Return early for non-HPH interpolators in HD2 control Ian Rogers
2026-11-19 17:07 ` [PATCH 2/2] ASoC: qcom: lpass-platform: Return IRQ_NONE on invalid DAI ID in DMA ISR Ian Rogers

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