Skip to content

Commit 880e626

Browse files
arndbJeff Kirsher
authored andcommitted
e1000e: fix unused-function warning
The CONFIG_PM_SLEEP #ifdef checks in this file are inconsistent, leading to a warning about sometimes unused function: drivers/net/ethernet/intel/e1000e/netdev.c:137:13: error: unused function 'e1000e_check_me' [-Werror,-Wunused-function] Rather than adding more #ifdefs, just remove them completely and mark the PM functions as __maybe_unused to let the compiler work it out on it own. Fixes: e086ba2 ("e1000e: disable s0ix entry and exit flows for ME systems") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent eb6779d commit 880e626

File tree

1 file changed

+5
-11
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+5
-11
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6349,7 +6349,6 @@ static void e1000e_flush_lpic(struct pci_dev *pdev)
63496349
pm_runtime_put_sync(netdev->dev.parent);
63506350
}
63516351

6352-
#ifdef CONFIG_PM_SLEEP
63536352
/* S0ix implementation */
63546353
static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter)
63556354
{
@@ -6571,7 +6570,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
65716570
mac_data &= ~E1000_CTRL_EXT_FORCE_SMBUS;
65726571
ew32(CTRL_EXT, mac_data);
65736572
}
6574-
#endif /* CONFIG_PM_SLEEP */
65756573

65766574
static int e1000e_pm_freeze(struct device *dev)
65776575
{
@@ -6875,7 +6873,6 @@ static int e1000e_pm_thaw(struct device *dev)
68756873
return rc;
68766874
}
68776875

6878-
#ifdef CONFIG_PM
68796876
static int __e1000_resume(struct pci_dev *pdev)
68806877
{
68816878
struct net_device *netdev = pci_get_drvdata(pdev);
@@ -6941,8 +6938,7 @@ static int __e1000_resume(struct pci_dev *pdev)
69416938
return 0;
69426939
}
69436940

6944-
#ifdef CONFIG_PM_SLEEP
6945-
static int e1000e_pm_suspend(struct device *dev)
6941+
static __maybe_unused int e1000e_pm_suspend(struct device *dev)
69466942
{
69476943
struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69486944
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -6966,7 +6962,7 @@ static int e1000e_pm_suspend(struct device *dev)
69666962
return rc;
69676963
}
69686964

6969-
static int e1000e_pm_resume(struct device *dev)
6965+
static __maybe_unused int e1000e_pm_resume(struct device *dev)
69706966
{
69716967
struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
69726968
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -6985,9 +6981,8 @@ static int e1000e_pm_resume(struct device *dev)
69856981

69866982
return e1000e_pm_thaw(dev);
69876983
}
6988-
#endif /* CONFIG_PM_SLEEP */
69896984

6990-
static int e1000e_pm_runtime_idle(struct device *dev)
6985+
static __maybe_unused int e1000e_pm_runtime_idle(struct device *dev)
69916986
{
69926987
struct net_device *netdev = dev_get_drvdata(dev);
69936988
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -7003,7 +6998,7 @@ static int e1000e_pm_runtime_idle(struct device *dev)
70036998
return -EBUSY;
70046999
}
70057000

7006-
static int e1000e_pm_runtime_resume(struct device *dev)
7001+
static __maybe_unused int e1000e_pm_runtime_resume(struct device *dev)
70077002
{
70087003
struct pci_dev *pdev = to_pci_dev(dev);
70097004
struct net_device *netdev = pci_get_drvdata(pdev);
@@ -7020,7 +7015,7 @@ static int e1000e_pm_runtime_resume(struct device *dev)
70207015
return rc;
70217016
}
70227017

7023-
static int e1000e_pm_runtime_suspend(struct device *dev)
7018+
static __maybe_unused int e1000e_pm_runtime_suspend(struct device *dev)
70247019
{
70257020
struct pci_dev *pdev = to_pci_dev(dev);
70267021
struct net_device *netdev = pci_get_drvdata(pdev);
@@ -7045,7 +7040,6 @@ static int e1000e_pm_runtime_suspend(struct device *dev)
70457040

70467041
return 0;
70477042
}
7048-
#endif /* CONFIG_PM */
70497043

70507044
static void e1000_shutdown(struct pci_dev *pdev)
70517045
{

0 commit comments

Comments
 (0)