Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756265AbcCBQF7 (ORCPT ); Wed, 2 Mar 2016 11:05:59 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:65408 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755863AbcCBQAn (ORCPT ); Wed, 2 Mar 2016 11:00:43 -0500 From: Arnd Bergmann To: Tom Lendacky Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , 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 Message-Id: <1456934350-1389172-10-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:P6KZ3jWJ+LNFemDBQyCYeSDTb2eF7bS/OJBLogWwupM5PVJgU9Y JZPimBNnxm2MAdCHMY6ygMlUTLKP2BEq+ZCArZyHN7iR8CfU+dYAoXqnrvAXJfXZLxr1VKP 7c2c7lsObPJ5XtQmMNDn5wHfQVIOq634mMFilzW85thSrX6Z65WGTkbECAyU4A07RNxf5Ka e3y/GQitWV0uGzwY/2vHA== X-UI-Out-Filterresults: notjunk:1;V01:K0:R1JB3BnUuGI=:f+o25f3JxnRP8wV9OmGAhI zoGFw3aKJVETzsZSiR40RGHsIxth0tMLTAVL3JMwXaktUpo5UMDH6stBYBccaYr1/HTS/Yqx/ XZEM2wbNnKFLL0xeu90QDm8jbjPyK4vx/Tj9dZYjcSLcTOhiN6WuU8hceercPjdKm4QoLao9J oW8hggIVFjRBljzgAPWMPHXBZGcQ5+uhCJsf4XTXDsXKWb8AgowWLIQ1oI8SAXYhhTxIDmiU3 27EUFY2pihWvBvsyJdpnznQ8LGAUKB972CJEz1oBVlYTz0qJuZB5Z9bYz+qQsEYRctvsixLyA Ydl87JBS8VEyYootgdCof7RYPMX8Y4wm8a89mKF7Q8XYe3pp56vYPreFCFaCUL1MpKoWPozLv 2R6qbKjEyke4+4Cf2piP67i3ll5Xnsx2ImR5BrXvIK6wGBpP8wa+wBmrovP6P6XjD61rp+BdK 5Q4W6xPkgM2RNmH1sKPkIq3jRXQFvzWbXcy51sTwJYGDuh97ieb8ds3tUbLM0KYfHw7wk9Ixo LgE6jvrTQxqsDxIyJTehIMUi6GIztS0H4zeCZSwjrAioI4ej0UpOhofjcOpSJk5gP+dguMw1B PfQaewIKQ7WhgDYU1qtzWJTrBqZZ68dwxrMYeLrlO5Rd3PG8vLJU58Xwl3YX2MMr1GMlFMG7J R/AH1nBgAjguMlurAojUrOaF4R3wYw44oz1bljzjI1gn4edQuZjqpvASw9BRPi1g3Hc0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1812 Lines: 50 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 --- 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