diff mbox series

[net-next] e1000e: Mark e1000e_pm_prepare() as __maybe_unused

Message ID 20210317145234.3171021-1-weiyongjun1@huawei.com
State New
Headers show
Series [net-next] e1000e: Mark e1000e_pm_prepare() as __maybe_unused | expand

Commit Message

Wei Yongjun March 17, 2021, 2:52 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

The function e1000e_pm_prepare() may have no callers depending
on configuration, so it must be marked __maybe_unused to avoid
harmless warning:

drivers/net/ethernet/intel/e1000e/netdev.c:6926:12:
 warning: 'e1000e_pm_prepare' defined but not used [-Wunused-function]
 6926 | static int e1000e_pm_prepare(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~

Fixes: ccf8b940e5fd ("e1000e: Leverage direct_complete to speed up s2ram")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sasha Neftin March 22, 2021, 6:56 a.m. UTC | #1
On 3/17/2021 16:52, 'w00385741 wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>

> 

> The function e1000e_pm_prepare() may have no callers depending

> on configuration, so it must be marked __maybe_unused to avoid

> harmless warning:

> 

> drivers/net/ethernet/intel/e1000e/netdev.c:6926:12:

>   warning: 'e1000e_pm_prepare' defined but not used [-Wunused-function]

>   6926 | static int e1000e_pm_prepare(struct device *dev)

>        |            ^~~~~~~~~~~~~~~~~

> 

> Fixes: ccf8b940e5fd ("e1000e: Leverage direct_complete to speed up s2ram")

> Reported-by: Hulk Robot <hulkci@huawei.com>

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

> ---

>   drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

Acked-by: Sasha Neftin <sasha.neftin@intel.com>

> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c

> index f1c9debd9f3b..d2e4653536c5 100644

> --- a/drivers/net/ethernet/intel/e1000e/netdev.c

> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c

> @@ -6923,7 +6923,7 @@ static int __e1000_resume(struct pci_dev *pdev)

>   	return 0;

>   }

>   

> -static int e1000e_pm_prepare(struct device *dev)

> +static __maybe_unused int e1000e_pm_prepare(struct device *dev)

>   {

>   	return pm_runtime_suspended(dev) &&

>   		pm_suspend_via_firmware();

> 

> _______________________________________________

> Intel-wired-lan mailing list

> Intel-wired-lan@osuosl.org

> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index f1c9debd9f3b..d2e4653536c5 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6923,7 +6923,7 @@  static int __e1000_resume(struct pci_dev *pdev)
 	return 0;
 }
 
-static int e1000e_pm_prepare(struct device *dev)
+static __maybe_unused int e1000e_pm_prepare(struct device *dev)
 {
 	return pm_runtime_suspended(dev) &&
 		pm_suspend_via_firmware();