Skip to contentSkip to conversation

PCI: tegra: mark PM functions as __maybe_unused

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 15, 2018

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

PATCH 1/1 PCI: tegra: mark PM functions as __maybe_unused

The new PM support causes a warning when CONFIG_PM is disabled:

drivers/pci/host/pci-tegra.c:2482:12: error: 'tegra_pcie_pm_resume' defined but not used [-Werror=unused-function]
static int tegra_pcie_pm_resume(struct device *dev)
drivers/pci/host/pci-tegra.c:2463:12: error: 'tegra_pcie_pm_suspend' defined but not used [-Werror=unused-function]
static int tegra_pcie_pm_suspend(struct device *dev)

Marking the functions as __maybe_unused lets the compiler drop them silently instead.

Fixes b90b44154023 ("PCI: tegra: Add power management support")
---
 drivers/pci/host/pci-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pci-tegra.c +2 -2
index 39c4af9cf055..389e74be846c 100644
@@ -2460,7 +2460,7 @@ static int tegra_pcie_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int tegra_pcie_pm_suspend(struct device *dev)
+static int __maybe_unused tegra_pcie_pm_suspend(struct device *dev)
 {
 	struct tegra_pcie *pcie = dev_get_drvdata(dev);
 	struct tegra_pcie_port *port;
@@ -2479,7 +2479,7 @@ static int tegra_pcie_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int tegra_pcie_pm_resume(struct device *dev)
+static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
 {
 	struct tegra_pcie *pcie = dev_get_drvdata(dev);
 	int err;
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

The new PM support causes a warning when CONFIG_PM is disabled:

drivers/pci/host/pci-tegra.c:2482:12: error: 'tegra_pcie_pm_resume' defined but not used [-Werror=unused-function]
static int tegra_pcie_pm_resume(struct device *dev)
drivers/pci/host/pci-tegra.c:2463:12: error: 'tegra_pcie_pm_suspend' defined but not used [-Werror=unused-function]
static int tegra_pcie_pm_suspend(struct device *dev)

Quoted 8 lines

Marking the functions as __maybe_unused lets the compiler drop them silently instead.

Fixes b90b44154023 ("PCI: tegra: Add power management support")
---
 drivers/pci/host/pci-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)