Skip to content

Commit b200bfd

Browse files
arndbdavem330
authored andcommitted
fm10k: mark PM functions as __maybe_unused
A cleanup of the PM code left an incorrect #ifdef in place, leading to a harmless build warning: drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2502:12: error: 'fm10k_suspend' defined but not used [-Werror=unused-function] drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2475:12: error: 'fm10k_resume' defined but not used [-Werror=unused-function] It's easier to use __maybe_unused attributes here, since you can't pick the wrong one. Fixes: 8249c47 ("fm10k: use generic PM hooks instead of legacy PCIe power hooks") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Krishneil Singh <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5762d7d commit b200bfd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/net/ethernet/intel/fm10k/fm10k_pci.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,6 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
24632463
return err;
24642464
}
24652465

2466-
#ifdef CONFIG_PM
24672466
/**
24682467
* fm10k_resume - Generic PM resume hook
24692468
* @dev: generic device structure
@@ -2472,7 +2471,7 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
24722471
* suspend or hibernation. This function does not need to handle lower PCIe
24732472
* device state as the stack takes care of that for us.
24742473
**/
2475-
static int fm10k_resume(struct device *dev)
2474+
static int __maybe_unused fm10k_resume(struct device *dev)
24762475
{
24772476
struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
24782477
struct net_device *netdev = interface->netdev;
@@ -2499,7 +2498,7 @@ static int fm10k_resume(struct device *dev)
24992498
* system suspend or hibernation. This function does not need to handle lower
25002499
* PCIe device state as the stack takes care of that for us.
25012500
**/
2502-
static int fm10k_suspend(struct device *dev)
2501+
static int __maybe_unused fm10k_suspend(struct device *dev)
25032502
{
25042503
struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
25052504
struct net_device *netdev = interface->netdev;
@@ -2511,8 +2510,6 @@ static int fm10k_suspend(struct device *dev)
25112510
return 0;
25122511
}
25132512

2514-
#endif /* CONFIG_PM */
2515-
25162513
/**
25172514
* fm10k_io_error_detected - called when PCI error is detected
25182515
* @pdev: Pointer to PCI device
@@ -2643,11 +2640,9 @@ static struct pci_driver fm10k_driver = {
26432640
.id_table = fm10k_pci_tbl,
26442641
.probe = fm10k_probe,
26452642
.remove = fm10k_remove,
2646-
#ifdef CONFIG_PM
26472643
.driver = {
26482644
.pm = &fm10k_pm_ops,
26492645
},
2650-
#endif /* CONFIG_PM */
26512646
.sriov_configure = fm10k_iov_configure,
26522647
.err_handler = &fm10k_err_handler
26532648
};

0 commit comments

Comments
 (0)