lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250522203020.1478369-1-rdunlap@infradead.org>
Date: Thu, 22 May 2025 13:30:20 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: linux-kernel@...r.kernel.org
Cc: Randy Dunlap <rdunlap@...radead.org>,
	Daniel Dadap <ddadap@...dia.com>,
	Takashi Iwai <tiwai@...e.de>,
	Jaroslav Kysela <perex@...ex.cz>,
	linux-sound@...r.kernel.org
Subject: [PATCH] ALSA: hda_acpi: eliminate defined but not used warnings

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@...radead.org>
Cc: Daniel Dadap <ddadap@...dia.com>
Cc: Takashi Iwai <tiwai@...e.de>
Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: linux-sound@...r.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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ