can: m_can: mark runtime-PM handlers as __maybe_unused
Subsystems (4)
PATCH 1/1 can: m_can: mark runtime-PM handlers as __maybe_unused
Building without CONFIG_PM results in a harmless warning:
drivers/net/can/m_can/m_can.c:1763:12: error: 'm_can_runtime_resume' defined but not used [-Werror=unused-function] drivers/net/can/m_can/m_can.c:1752:12: error: 'm_can_runtime_suspend' defined but not used [-Werror=unused-function]
Marking the functions as __maybe_unused lets the compiler silently drop them instead.
--- drivers/net/can/m_can/m_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/m_can/m_can.c +2 -2
@@ -1749,7 +1749,7 @@ static int m_can_plat_remove(struct platform_device *pdev)return 0 ; } -static int m_can_runtime_suspend (struct device *dev) +static int __maybe_unused m_can_runtime_suspend (struct device *dev) {struct net_device *ndev =dev_get_drvdata (dev);struct m_can_priv *priv =netdev_priv (ndev);
@@ -1760,7 +1760,7 @@ static int m_can_runtime_suspend(struct device *dev)return 0 ; } -static int m_can_runtime_resume (struct device *dev) +static int __maybe_unused m_can_runtime_resume (struct device *dev) {struct net_device *ndev =dev_get_drvdata (dev);struct m_can_priv *priv =netdev_priv (ndev);
Signature · 1 line
2.9.0
Marc Kleine-Budde
maintainerQuoted 10 lines · Arnd Bergmann
Building without
CONFIG_PMresults in a harmless warning:
drivers/net/can/m_can/m_can.c:1763:12: error: 'm_can_runtime_resume' defined but not used [-Werror=unused-function]drivers/net/can/m_can/m_can.c:1752:12: error: 'm_can_runtime_suspend' defined but not used [-Werror=unused-function]Marking the functions as
__maybe_unusedlets the compiler silently drop them instead.Fixes cdf8259d6573 ("can: m_can: Add PM Support")Signed-off-by Arnd Bergmann <[email protected]>
Tnx - applied.
However all archs using this driver have mandatory PM support and the driver depends on it.
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |