]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: stmmac: mark PM functions as __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Mon, 13 Aug 2018 21:50:41 +0000 (23:50 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:55:13 +0000 (19:55 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit 81a8b0799632627b587af31ecd06112397e4ec36 ]

The newly added suspend/resume functions cause a build warning
when CONFIG_PM is disabled:

drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:324:12: error: 'stmmac_pci_resume' defined but not used [-Werror=unused-function]
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:306:12: error: 'stmmac_pci_suspend' defined but not used [-Werror=unused-function]

Mark them as __maybe_unused so gcc can drop them silently.

Fixes: b7d0f08e9129 ("net: stmmac: Fix WoL for PCI-based setups")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c

index 6a393b16a1fcaf924473e7a56968d69e57f12f7e..c54a50dbd5ac264faa439550f949a981cb0440ae 100644 (file)
@@ -303,7 +303,7 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
        pci_disable_device(pdev);
 }
 
-static int stmmac_pci_suspend(struct device *dev)
+static int __maybe_unused stmmac_pci_suspend(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
        int ret;
@@ -321,7 +321,7 @@ static int stmmac_pci_suspend(struct device *dev)
        return 0;
 }
 
-static int stmmac_pci_resume(struct device *dev)
+static int __maybe_unused stmmac_pci_resume(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
        int ret;