patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: SDCA: Fix uninitialized use of name in sdca_irq_populate()
@ 2025-07-16  3:34 Nathan Chancellor
  2025-07-16  8:25 ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2025-07-16  3:34 UTC (permalink / raw)
  To: Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	Mark Brown
  Cc: linux-sound, patches, llvm, patches, Nathan Chancellor

After a recent change in clang to strengthen uninitialized warnings [1],
it points out that name is used uninitialized in sdca_irq_populate():

  sound/soc/sdca/sdca_interrupts.c:388:6: error: variable 'name' is uninitialized when used here [-Werror,-Wuninitialized]
    388 |                                         name, ret);
        |                                         ^~~~

Remove name and use the name member in the interrupt variable, as that
is the proper string to print.

Fixes: b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7 [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/soc/sdca/sdca_interrupts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index 2f85fcc6e544..6df3b1a4d599 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -342,7 +342,6 @@ int sdca_irq_populate(struct sdca_function_data *function,
 			int irq = control->interrupt_position;
 			struct sdca_interrupt *interrupt;
 			irq_handler_t handler;
-			const char *name;
 			int ret;
 
 			if (irq == SDCA_NO_INTERRUPT) {
@@ -385,7 +384,7 @@ int sdca_irq_populate(struct sdca_function_data *function,
 						      handler, interrupt);
 			if (ret) {
 				dev_err(dev, "failed to request irq %s: %d\n",
-					name, ret);
+					interrupt->name, ret);
 				return ret;
 			}
 		}

---
base-commit: 6bd62e3ffe865ddcd9866856f7112dd3a7484b65
change-id: 20250715-sdca_interrupts-fix-const-uninit-warning-c4db91e0ca0a

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


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

end of thread, other threads:[~2025-07-16 20:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  3:34 [PATCH] ASoC: SDCA: Fix uninitialized use of name in sdca_irq_populate() Nathan Chancellor
2025-07-16  8:25 ` Charles Keepax
2025-07-16 20:02   ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).