linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM
@ 2023-04-28 21:43 Tom Rix
  2023-05-01  6:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-04-28 21:43 UTC (permalink / raw)
  To: irusskikh, davem, edumazet, kuba, pabeni; +Cc: netdev, linux-kernel, Tom Rix

For s390, gcc with W=1 reports
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:458:32: error:
  'aq_pm_ops' defined but not used [-Werror=unused-const-variable=]
  458 | static const struct dev_pm_ops aq_pm_ops = {
      |                                ^~~~~~~~~

The only use of aq_pm_ops is conditional on CONFIG_PM.
The definition of aq_pm_ops and its functions should also
be conditional on CONFIG_PM.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index 8647125d60ae..baa5f8cc31f2 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -379,6 +379,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev)
 	}
 }
 
+#ifdef CONFIG_PM
 static int aq_suspend_common(struct device *dev)
 {
 	struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev));
@@ -463,6 +464,7 @@ static const struct dev_pm_ops aq_pm_ops = {
 	.restore = aq_pm_resume_restore,
 	.thaw = aq_pm_thaw,
 };
+#endif
 
 static struct pci_driver aq_pci_ops = {
 	.name = AQ_CFG_DRV_NAME,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM
  2023-04-28 21:43 [PATCH] net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM Tom Rix
@ 2023-05-01  6:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-01  6:40 UTC (permalink / raw)
  To: Tom Rix; +Cc: irusskikh, davem, edumazet, kuba, pabeni, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 28 Apr 2023 17:43:21 -0400 you wrote:
> For s390, gcc with W=1 reports
> drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:458:32: error:
>   'aq_pm_ops' defined but not used [-Werror=unused-const-variable=]
>   458 | static const struct dev_pm_ops aq_pm_ops = {
>       |                                ^~~~~~~~~
> 
> The only use of aq_pm_ops is conditional on CONFIG_PM.
> The definition of aq_pm_ops and its functions should also
> be conditional on CONFIG_PM.
> 
> [...]

Here is the summary with links:
  - net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM
    https://git.kernel.org/netdev/net/c/4f163bf82b02

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-01  6:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 21:43 [PATCH] net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM Tom Rix
2023-05-01  6:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).