All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: tegra: mark PM functions as __maybe_unused
@ 2018-03-15 16:18 Arnd Bergmann
  2018-03-15 16:49 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-03-15 16:18 UTC (permalink / raw)
  To: Thierry Reding, Lorenzo Pieralisi, Bjorn Helgaas, Jonathan Hunter
  Cc: Arnd Bergmann, Manikanta Maddireddy, Stephen Warren, Vidya Sagar,
	linux-tegra, linux-pci, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/pci/host/pci-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 39c4af9cf055..389e74be846c 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -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;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: tegra: mark PM functions as __maybe_unused
  2018-03-15 16:18 [PATCH] PCI: tegra: mark PM functions as __maybe_unused Arnd Bergmann
@ 2018-03-15 16:49 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2018-03-15 16:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lorenzo Pieralisi, Bjorn Helgaas, Jonathan Hunter,
	Manikanta Maddireddy, Stephen Warren, Vidya Sagar, linux-tegra,
	linux-pci, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

On Thu, Mar 15, 2018 at 05:18:39PM +0100, Arnd Bergmann wrote:
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/pci/host/pci-tegra.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-15 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 16:18 [PATCH] PCI: tegra: mark PM functions as __maybe_unused Arnd Bergmann
2018-03-15 16:49 ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.