public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Intel: Initialize chip in hda_sdw_check_wakeen_irq()
@ 2023-08-09 18:12 Nathan Chancellor
  2023-08-09 18:41 ` Pierre-Louis Bossart
  2023-08-10 11:39 ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Nathan Chancellor @ 2023-08-09 18:12 UTC (permalink / raw)
  To: broonie, pierre-louis.bossart, lgirdwood, peter.ujfalusi,
	yung-chuan.liao, ranjani.sridharan, daniel.baluta
  Cc: kai.vehmanen, ndesaulniers, trix, rander.wang,
	sound-open-firmware, alsa-devel, llvm, patches, Nathan Chancellor

Clang warns (or errors with CONFIG_WERROR):

  sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized]
    423 |         if (chip && chip->check_sdw_wakeen_irq)
        |             ^~~~
  sound/soc/sof/intel/hda.c:418:39: note: initialize the variable 'chip' to silence this warning
    418 |         const struct sof_intel_dsp_desc *chip;
        |                                              ^
        |                                               = NULL
  1 error generated.

Add the missing initialization, following the pattern of the other irq
functions.

Fixes: 9362ab78f175 ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/soc/sof/intel/hda.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 04c748a72b13..15e6779efaa3 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -420,6 +420,7 @@ static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
 	if (!(interface_mask & BIT(SOF_DAI_INTEL_ALH)))
 		return false;
 
+	chip = get_chip_info(sdev->pdata);
 	if (chip && chip->check_sdw_wakeen_irq)
 		return chip->check_sdw_wakeen_irq(sdev);
 

---
base-commit: 59146c3cd326a622e9041614842346aada11ca99
change-id: 20230809-intel-hda-missing-chip-init-dcccbe6365a4

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

end of thread, other threads:[~2023-08-10 14:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 18:12 [PATCH] ASoC: SOF: Intel: Initialize chip in hda_sdw_check_wakeen_irq() Nathan Chancellor
2023-08-09 18:41 ` Pierre-Louis Bossart
2023-08-09 19:02   ` Nathan Chancellor
2023-08-09 19:57     ` Pierre-Louis Bossart
2023-08-09 20:09       ` Nathan Chancellor
2023-08-09 20:42         ` Pierre-Louis Bossart
2023-08-10 14:33           ` Nathan Chancellor
2023-08-10 11:39 ` Mark Brown

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