From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
Daniel Dadap <ddadap@nvidia.com>, Takashi Iwai <tiwai@suse.de>,
Jaroslav Kysela <perex@perex.cz>,
linux-sound@vger.kernel.org
Subject: [PATCH] ALSA: hda_acpi: eliminate defined but not used warnings
Date: Thu, 22 May 2025 13:30:20 -0700 [thread overview]
Message-ID: <20250522203020.1478369-1-rdunlap@infradead.org> (raw)
When CONFIG_PM_SLEEP is not set, the hda_acpi_suspend() and
hda_acpi_resume() functions are not used and cause build warnings:
sound/pci/hda/hda_acpi.c:282:12: warning: 'hda_acpi_resume' defined but not used [-Wunused-function]
282 | static int hda_acpi_resume(struct device *dev)
sound/pci/hda/hda_acpi.c:269:12: warning: 'hda_acpi_suspend' defined but not used [-Wunused-function]
269 | static int hda_acpi_suspend(struct device *dev)
Enclose these functions inside an ifdef CONFIG_PM_SLEEP block to
prevent the warnings.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Daniel Dadap <ddadap@nvidia.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: linux-sound@vger.kernel.org
---
sound/pci/hda/hda_acpi.c | 2 ++
1 file changed, 2 insertions(+)
--- linux-next-20250522.orig/sound/pci/hda/hda_acpi.c
+++ linux-next-20250522/sound/pci/hda/hda_acpi.c
@@ -266,6 +266,7 @@ static void hda_acpi_shutdown(struct pla
azx_stop_chip(chip);
}
+#ifdef CONFIG_PM_SLEEP
static int hda_acpi_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
@@ -291,6 +292,7 @@ static int hda_acpi_resume(struct device
return 0;
}
+#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops hda_acpi_pm = {
SET_SYSTEM_SLEEP_PM_OPS(hda_acpi_suspend, hda_acpi_resume)
next reply other threads:[~2025-05-22 20:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-22 20:30 Randy Dunlap [this message]
2025-05-22 20:42 ` Takashi Iwai
2025-05-22 21:12 ` Daniel Dadap
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=20250522203020.1478369-1-rdunlap@infradead.org \
--to=rdunlap@infradead.org \
--cc=ddadap@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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
all inboxes | Powered by JetHome®