Skip to contentSkip to conversation

sun/niu: add __maybe_unused attribute to PM functions

PATCH Applied Vaibhav Gupta 2 participants 2 messages Jul 7, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sun/niu: add __maybe_unused attribute to PM functions

The upgraded .suspend() and .resume() throw
"defined but not used [-Wunused-function]" warning for certain configurations.

Mark them with "__maybe_unused" attribute.

Compile-tested only.

Fixes b0db0cc2f695 ("sun/niu: use generic power management")
---
 drivers/net/ethernet/sun/niu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/sun/niu.c +2 -2
index 68541c823245..b4e20d15d138 100644
@@ -9873,7 +9873,7 @@ static void niu_pci_remove_one(struct pci_dev *pdev)
 	}
 }
 
-static int niu_suspend(struct device *dev_d)
+static int __maybe_unused niu_suspend(struct device *dev_d)
 {
 	struct net_device *dev = dev_get_drvdata(dev_d);
 	struct niu *np = netdev_priv(dev);
@@ -9900,7 +9900,7 @@ static int niu_suspend(struct device *dev_d)
 	return 0;
 }
 
-static int niu_resume(struct device *dev_d)
+static int __maybe_unused niu_resume(struct device *dev_d)
 {
 	struct net_device *dev = dev_get_drvdata(dev_d);
 	struct niu *np = netdev_priv(dev);
Signature · 6 lines
2.27.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
maintainer Applied
#1 lore raw

From: Vaibhav Gupta <[email protected]>
Date: Tue, 7 Jul 2020 13:11:22 +0530

Quoted 11 lines

The upgraded .suspend() and .resume() throw
"defined but not used [-Wunused-function]" warning for certain configurations.

Mark them with "__maybe_unused" attribute.

Compile-tested only.

Fixes b0db0cc2f695 ("sun/niu: use generic power management")

Applied.