From: Arnd Bergmann <arnd@arndb.de>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-arm-kernel@lists.infradead.org,
Arnd Bergmann <arnd@arndb.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 09/14] amd-xgbe: use __maybe_unused to hide pm functions
Date: Wed, 2 Mar 2016 16:59:01 +0100 [thread overview]
Message-ID: <1456934350-1389172-10-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de>
The amd-xgbe ethernet driver hides its suspend/resume functions
in #ifdef CONFIG_PM, but uses SIMPLE_DEV_PM_OPS() to make the
reference conditional on CONFIG_PM_SLEEP, which results in a
warning when PM_SLEEP is not set but PM is:
drivers/net/ethernet/amd/xgbe/xgbe-main.c:833:12: warning: 'xgbe_suspend' defined but not used [-Wunused-function]
drivers/net/ethernet/amd/xgbe/xgbe-main.c:853:12: warning: 'xgbe_resume' defined but not used [-Wunused-function]
This removes the incorrect #ifdef and instead uses a __maybe_unused
annotation to let the compiler know it can silently drop
the function definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 3eee3201b58f..a86f32106639 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -829,8 +829,7 @@ static int xgbe_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int xgbe_suspend(struct device *dev)
+static int __maybe_unused xgbe_suspend(struct device *dev)
{
struct net_device *netdev = dev_get_drvdata(dev);
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -850,7 +849,7 @@ static int xgbe_suspend(struct device *dev)
return ret;
}
-static int xgbe_resume(struct device *dev)
+static int __maybe_unused xgbe_resume(struct device *dev)
{
struct net_device *netdev = dev_get_drvdata(dev);
struct xgbe_prv_data *pdata = netdev_priv(netdev);
@@ -868,7 +867,6 @@ static int xgbe_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM */
#ifdef CONFIG_ACPI
static const struct acpi_device_id xgbe_acpi_match[] = {
--
2.7.0
next prev parent reply other threads:[~2016-03-02 16:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 15:58 [PATCH 00/14] drivers: " Arnd Bergmann
2016-03-02 15:58 ` [PATCH 01/14] pinctrl: at91: " Arnd Bergmann
2016-03-02 16:06 ` Nicolas Ferre
2016-03-02 16:47 ` Ludovic Desroches
2016-03-09 4:09 ` Linus Walleij
2016-03-02 15:58 ` [PATCH 02/14] irqchip: st: use __maybe_unused to hide st_irq_syscfg_resume Arnd Bergmann
2016-03-02 15:58 ` [PATCH 03/14] power: ipaq-micro-battery: use __maybe_unused to hide pm functions Arnd Bergmann
2016-03-03 14:23 ` Sebastian Reichel
2016-03-02 15:58 ` [PATCH 04/14] power: pm2301-charger: " Arnd Bergmann
2016-03-03 14:23 ` Sebastian Reichel
2016-03-02 15:58 ` [PATCH 05/14] mfd: ipaq-micro: " Arnd Bergmann
2016-03-08 4:27 ` Lee Jones
2016-03-02 15:58 ` [PATCH 06/14] dma: sirf: " Arnd Bergmann
2016-03-03 3:47 ` Vinod Koul
2016-03-03 12:33 ` Arnd Bergmann
2016-03-04 15:02 ` Vinod Koul
2016-03-02 15:58 ` [PATCH 07/14] hw_random: exynos: " Arnd Bergmann
2016-03-02 23:43 ` Krzysztof Kozlowski
2016-03-11 13:31 ` Herbert Xu
2016-03-02 15:59 ` [PATCH 08/14] scsi: mvumi: " Arnd Bergmann
2016-03-03 8:30 ` Johannes Thumshirn
2016-03-05 22:08 ` Martin K. Petersen
2016-03-02 15:59 ` Arnd Bergmann [this message]
2016-03-02 15:59 ` [PATCH 10/14] wireless: cw1200: use __maybe_unused to hide pm functions_ Arnd Bergmann
2016-03-08 10:33 ` [10/14] " Kalle Valo
2016-03-02 15:59 ` [PATCH 11/14] input: spear-keyboard: use __maybe_unused to hide pm functions Arnd Bergmann
2016-03-02 17:12 ` Dmitry Torokhov
2016-03-02 15:59 ` [PATCH 12/14] keyboard: snvs-pwrkey: " Arnd Bergmann
2016-03-02 16:04 ` Frank Li
2016-03-02 17:12 ` Dmitry Torokhov
2016-03-02 15:59 ` [PATCH 13/14] [media] omap3isp: use IS_ENABLED() " Arnd Bergmann
2016-03-02 15:59 ` [PATCH 14/14] ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resume Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456934350-1389172-10-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®