From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034745AbdD0TKC (ORCPT ); Thu, 27 Apr 2017 15:10:02 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:57187 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756310AbdD0TJv (ORCPT ); Thu, 27 Apr 2017 15:09:51 -0400 From: Arnd Bergmann To: Jeff Kirsher Cc: Arnd Bergmann , Alexander Duyck , "David S. Miller" , Jacob Keller , Todd Fujinaka , Yury Kylulin , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] igb: mark PM functions as __maybe_unused Date: Thu, 27 Apr 2017 21:09:52 +0200 Message-Id: <20170427191007.1990964-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:sfsb2oReddkDqk790eO0ccUvkH0neNOvwzbb0fCZ7qzytQzY76s cA2BbXBbKJV1v9R+4g5W/rEw3a/zXJxIr2u5CMWeOr2YdcKn86z7Qc1cxDlvncsQ/vv3rvU c/q8c862kv63Y5oTM1VHkL9Wn6jwn0QBh16rsLmYkfAeJT2DRKO6Ho5BixnRp/71GtlmgeB NqOZqcjaZKvPORyYfOpqQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Y0UTbEkaTRs=:sTtio68aUtoawkE+02i4Rv rh4DwwhEqnAd5kUN/8U26yKm+m2oZB31+dfk0Z9BIugQ2p4xIkwAQYCVBiq6UoZhMCGxTsx6M b+UgcpPeM49y9zRZhSfxnseUa0swa7x+iFv+NvtJdWLNhgwV9+V2J0SJV3kpPvFx70hgFlcHx VEaQx+mpwOD6sb8NmGzLjFINZEvj33Ms9TrtpRDXb8JhYzWXb1kPQFBxU+PFXNMrUzBTBr8/v PEIcswf9KfbcDd7PiTU0gGSNO/TblGnhVaaaNnPYbWDGPbjkk4Tcgew9fSS+PYpU7bvOwyHBG rNUpXAlf60KN7Zh7wdHIaWYVvfqx2vfgY3q9jZZhpwCF1pLp0nnumcBn5zv5XdQZDutDKevpJ aTbLd06ic+d5xZr+hqVrf7kkdviPPmd0/cCQCp2VUSebjUd6ohF7OTmboWYWAATORCtu2faO6 v1CbWs33y0QWIc/8SPYvc6LN+D7/5rUTHlKMjIwYtR4VIVya1IecxYILtaFgXE/e4TZtk/aNe e0PH+U33emGrU6MlKT3cUvTflwtoYvOg62/KGAKB3qHzekgyQ37ueGvNb3f/LHV8sCaFehLt5 SXAy/+pU8x2oJbXSKCkDZ0/8wOkfjueu2VG0/NXKh4rpnOllvsH23Si0+fR/4rdkHEu0Vedxf ot5HIEqlrCHm/yKf9GjvjFKCDLpzVJmdcGEE8UoL6pkKnAVqlsL3vWB3PGMXfsgQGKPo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new wake function is only used by the suspend/resume handlers that are defined in inside of an #ifdef, which can cause this harmless warning: drivers/net/ethernet/intel/igb/igb_main.c:7988:13: warning: 'igb_deliver_wake_packet' defined but not used [-Wunused-function] Removing the #ifdef, instead using a __maybe_unused annotation simplifies the code and avoids the warning. Fixes: b90fa8763560 ("igb: Enable reading of wake up packet") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/intel/igb/igb_main.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 1cf74aa4ebd9..2d5bdb1fd37d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -191,10 +191,7 @@ static int igb_disable_sriov(struct pci_dev *dev); static int igb_pci_disable_sriov(struct pci_dev *dev); #endif -#ifdef CONFIG_PM -#ifdef CONFIG_PM_SLEEP static int igb_suspend(struct device *); -#endif static int igb_resume(struct device *); static int igb_runtime_suspend(struct device *dev); static int igb_runtime_resume(struct device *dev); @@ -204,7 +201,6 @@ static const struct dev_pm_ops igb_pm_ops = { SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume, igb_runtime_idle) }; -#endif static void igb_shutdown(struct pci_dev *); static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs); #ifdef CONFIG_IGB_DCA @@ -8015,9 +8011,7 @@ static void igb_deliver_wake_packet(struct net_device *netdev) netif_rx(skb); } -#ifdef CONFIG_PM -#ifdef CONFIG_PM_SLEEP -static int igb_suspend(struct device *dev) +static int __maybe_unused igb_suspend(struct device *dev) { int retval; bool wake; @@ -8036,9 +8030,8 @@ static int igb_suspend(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static int igb_resume(struct device *dev) +static int __maybe_unused igb_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = pci_get_drvdata(pdev); @@ -8092,7 +8085,7 @@ static int igb_resume(struct device *dev) return err; } -static int igb_runtime_idle(struct device *dev) +static int __maybe_unused igb_runtime_idle(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = pci_get_drvdata(pdev); @@ -8104,7 +8097,7 @@ static int igb_runtime_idle(struct device *dev) return -EBUSY; } -static int igb_runtime_suspend(struct device *dev) +static int __maybe_unused igb_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); int retval; @@ -8124,11 +8117,10 @@ static int igb_runtime_suspend(struct device *dev) return 0; } -static int igb_runtime_resume(struct device *dev) +static int __maybe_unused igb_runtime_resume(struct device *dev) { return igb_resume(dev); } -#endif /* CONFIG_PM */ static void igb_shutdown(struct pci_dev *pdev) { -- 2.9.0