Skip to contentSkip to conversation

mfd: exynos-lpass: mark PM functions as __maybe_unused

PATCH Applied Arnd Bergmann 3 participants 3 messages Sep 6, 2016 – Sep 13, 2016

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

PATCH 1/1 mfd: exynos-lpass: mark PM functions as __maybe_unused

The newly added exynos lpass driver produces a build warning when CONFIG_PM is disabled since the only callers of exynos_lpass_disable are under an #ifdef:

drivers/mfd/exynos-lpass.c:93:13: error: 'exynos_lpass_disable' defined but not used [-Werror=unused-function]
static void exynos_lpass_disable(struct exynos_lpass *lpass)

This removes the #ifdef and replaces it with __maybe_unused annotations so the compiler can leave out the unused code silently with less room for mistakes.

Fixes 36c26760bba8 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")
---
 drivers/mfd/exynos-lpass.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/exynos-lpass.c +2 -4
index 578ac7b57b96..2e064fb8826f 100644
@@ -144,8 +144,7 @@ static int exynos_lpass_probe(struct platform_device *pdev)
 	return of_platform_populate(dev->of_node, NULL, NULL, dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int exynos_lpass_suspend(struct device *dev)
+static int __maybe_unused exynos_lpass_suspend(struct device *dev)
 {
 	struct exynos_lpass *lpass = dev_get_drvdata(dev);
 
@@ -154,7 +153,7 @@ static int exynos_lpass_suspend(struct device *dev)
 	return 0;
 }
 
-static int exynos_lpass_resume(struct device *dev)
+static int __maybe_unused exynos_lpass_resume(struct device *dev)
 {
 	struct exynos_lpass *lpass = dev_get_drvdata(dev);
 
@@ -162,7 +161,6 @@ static int exynos_lpass_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend,
 					exynos_lpass_resume);
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

The newly added exynos lpass driver produces a build warning when CONFIG_PM is disabled since the only callers of exynos_lpass_disable are under an #ifdef:

drivers/mfd/exynos-lpass.c:93:13: error: 'exynos_lpass_disable' defined but not used [-Werror=unused-function]
static void exynos_lpass_disable(struct exynos_lpass *lpass)

Quoted 6 lines

This removes the #ifdef and replaces it with __maybe_unused annotations so the compiler can leave out the unused code silently with less room for mistakes.

Fixes 36c26760bba8 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")

Thanks for fixing this,

Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

The newly added exynos lpass driver produces a build warning when CONFIG_PM is disabled since the only callers of exynos_lpass_disable are under an #ifdef:

drivers/mfd/exynos-lpass.c:93:13: error: 'exynos_lpass_disable' defined but not used [-Werror=unused-function]
static void exynos_lpass_disable(struct exynos_lpass *lpass)

This removes the #ifdef and replaces it with __maybe_unused annotations so the compiler can leave out the unused code silently with less room for mistakes.

Quoted 5 lines
Fixes 36c26760bba8 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")
---
 drivers/mfd/exynos-lpass.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Quoted 31 lines
drivers/mfd/exynos-lpass.c +2 -4
index 578ac7b57b96..2e064fb8826f 100644
@@ -144,8 +144,7 @@ static int exynos_lpass_probe(struct platform_device *pdev)
 	return of_platform_populate(dev->of_node, NULL, NULL, dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int exynos_lpass_suspend(struct device *dev)
+static int __maybe_unused exynos_lpass_suspend(struct device *dev)
 {
 	struct exynos_lpass *lpass = dev_get_drvdata(dev);
 
@@ -154,7 +153,7 @@ static int exynos_lpass_suspend(struct device *dev)
 	return 0;
 }
 
-static int exynos_lpass_resume(struct device *dev)
+static int __maybe_unused exynos_lpass_resume(struct device *dev)
 {
 	struct exynos_lpass *lpass = dev_get_drvdata(dev);
 
@@ -162,7 +161,6 @@ static int exynos_lpass_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend,
 					exynos_lpass_resume);
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog