patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>,
	 Maciej Strozek <mstrozek@opensource.cirrus.com>,
	 Bard Liao <yung-chuan.liao@linux.intel.com>,
	 Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	 Mark Brown <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	 llvm@lists.linux.dev, patches@lists.linux.dev,
	 Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] ASoC: SDCA: Fix uninitialized use of name in sdca_irq_populate()
Date: Tue, 15 Jul 2025 20:34:21 -0700	[thread overview]
Message-ID: <20250715-sdca_interrupts-fix-const-uninit-warning-v1-1-cc031c913499@kernel.org> (raw)

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>


             reply	other threads:[~2025-07-16  3:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16  3:34 Nathan Chancellor [this message]
2025-07-16  8:25 ` [PATCH] ASoC: SDCA: Fix uninitialized use of name in sdca_irq_populate() Charles Keepax
2025-07-16 20:02   ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250715-sdca_interrupts-fix-const-uninit-warning-v1-1-cc031c913499@kernel.org \
    --to=nathan@kernel.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mstrozek@opensource.cirrus.com \
    --cc=patches@lists.linux.dev \
    --cc=patches@opensource.cirrus.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).