Skip to contentSkip to conversation

ath10: mark PM functions as __maybe_unused

PATCH Applied Arnd Bergmann 2 participants 3 messages Sep 6, 2017 – Sep 21, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10: mark PM functions as __maybe_unused

When CONFIG_PM_SLEEP is disabled, we get a compile-time warning:

drivers/net/wireless/ath/ath10k/pci.c:3417:12: error: 'ath10k_pci_pm_resume' defined but not used [-Werror=unused-function]
static int ath10k_pci_pm_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~~~

drivers/net/wireless/ath/ath10k/pci.c:3401:12: error: 'ath10k_pci_pm_suspend' defined but not used [-Werror=unused-function]
static int ath10k_pci_pm_suspend(struct device *dev)

Rather than fixing the #ifdef, this just marks both functions as __maybe_unused, which is a more robust way to do this.

Fixes 32faa3f0ee50 ("ath10k: add the PCI PM core suspend/resume ops")
---
 drivers/net/wireless/ath/ath10k/pci.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +2 -5
index bc1633945a56..195dafb98131 100644
@@ -3396,9 +3396,7 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
 
 MODULE_DEVICE_TABLE(pci, ath10k_pci_id_table);
 
-#ifdef CONFIG_PM
-
-static int ath10k_pci_pm_suspend(struct device *dev)
+static __maybe_unused int ath10k_pci_pm_suspend(struct device *dev)
 {
 	struct ath10k *ar = dev_get_drvdata(dev);
 	int ret;
@@ -3414,7 +3412,7 @@ static int ath10k_pci_pm_suspend(struct device *dev)
 	return ret;
 }
 
-static int ath10k_pci_pm_resume(struct device *dev)
+static __maybe_unused int ath10k_pci_pm_resume(struct device *dev)
 {
 	struct ath10k *ar = dev_get_drvdata(dev);
 	int ret;
@@ -3433,7 +3431,6 @@ static int ath10k_pci_pm_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(ath10k_pci_pm_ops,
 			 ath10k_pci_pm_suspend,
 			 ath10k_pci_pm_resume);
-#endif
 
 static struct pci_driver ath10k_pci_driver = {
 	.name = "ath10k_pci",
Signature · 1 line
2.9.0
#1 lore raw
Quoted 4 lines · Arnd Bergmann

When CONFIG_PM_SLEEP is disabled, we get a compile-time warning:

drivers/net/wireless/ath/ath10k/pci.c:3417:12: error: 'ath10k_pci_pm_resu=

me' defined but not used [-Werror=3Dunused-function]

Quoted 3 lines

static int ath10k_pci_pm_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~~~

drivers/net/wireless/ath/ath10k/pci.c:3401:12: error: 'ath10k_pci_pm_susp=

end' defined but not used [-Werror=3Dunused-function]

Quoted 7 lines

static int ath10k_pci_pm_suspend(struct device *dev)

Rather than fixing the #ifdef, this just marks both functions as __maybe_unused, which is a more robust way to do this.

Fixes 32faa3f0ee50 ("ath10k: add the PCI PM core suspend/resume ops")

Thanks. But the title should have "ath10k:", I'll fix that.

--=20
Kalle Valo=

Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

When CONFIG_PM_SLEEP is disabled, we get a compile-time warning:

drivers/net/wireless/ath/ath10k/pci.c:3417:12: error: 'ath10k_pci_pm_resume' defined but not used [-Werror=unused-function]
static int ath10k_pci_pm_resume(struct device *dev)

            ^~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

drivers/net/wireless/ath/ath10k/pci.c:3401:12: error: 'ath10k_pci_pm_suspend' defined but not used [-Werror=unused-function]
static int ath10k_pci_pm_suspend(struct device *dev)

Rather than fixing the #ifdef, this just marks both functions as __maybe_unused, which is a more robust way to do this.

Fixes 32faa3f0ee50 ("ath10k: add the PCI PM core suspend/resume ops")

Applied to ath-current branch in ath.git, thanks.

(Having problems with my patchwork script so sending this manually)

Signature · 1 line
Kalle Valo