Skip to contentSkip to conversation

rockchip/rga: annotate PM functions as __maybe_unused

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 19, 2017 – Oct 27, 2017

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

PATCH 1/1 rockchip/rga: annotate PM functions as __maybe_unused

The newly added driver has incorrect #ifdef annotations on its PM functions, leading to a harmless compile-time warning when CONFIG_PM is disabled:

drivers/media/platform/rockchip/rga/rga.c:760:13: error: 'rga_disable_clocks' defined but not used [-Werror=unused-function]
static void rga_disable_clocks(struct rockchip_rga *rga)

             ^~~~~~~~~~~~~~~~~~

drivers/media/platform/rockchip/rga/rga.c:728:12: error: 'rga_enable_clocks' defined but not used [-Werror=unused-function]

This removes the #ifdef and marks the functions as __maybe_unused, so gcc can silently drop all the unused code.

Fixes f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support")
---
 drivers/media/platform/rockchip/rga/rga.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/media/platform/rockchip/rga/rga.c +2 -4
index e7d1b34baf1c..89296de9cf4a 100644
@@ -960,8 +960,7 @@ static int rga_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int rga_runtime_suspend(struct device *dev)
+static int __maybe_unused rga_runtime_suspend(struct device *dev)
 {
 	struct rockchip_rga *rga = dev_get_drvdata(dev);
 
@@ -970,13 +969,12 @@ static int rga_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int rga_runtime_resume(struct device *dev)
+static int __maybe_unused rga_runtime_resume(struct device *dev)
 {
 	struct rockchip_rga *rga = dev_get_drvdata(dev);
 
 	return rga_enable_clocks(rga);
 }
-#endif
 
 static const struct dev_pm_ops rga_pm = {
 	SET_RUNTIME_PM_OPS(rga_runtime_suspend,
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Arnd Bergmann

The newly added driver has incorrect #ifdef annotations on its PM functions, leading to a harmless compile-time warning when CONFIG_PM is disabled:

drivers/media/platform/rockchip/rga/rga.c:760:13: error: 'rga_disable_clocks' defined but not used [-Werror=unused-function]
static void rga_disable_clocks(struct rockchip_rga *rga)

Quoted 8 lines
             ^~~~~~~~~~~~~~~~~~

drivers/media/platform/rockchip/rga/rga.c:728:12: error: 'rga_enable_clocks' defined but not used [-Werror=unused-function]

This removes the #ifdef and marks the functions as __maybe_unused, so gcc can silently drop all the unused code.

Fixes f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support")
Signature · 2 lines
Sakari Ailus
e-mail: sakari.ailus at iki.fi