linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: x-gene: mark PM functions as __maybe_unused
@ 2017-11-08 12:08 Arnd Bergmann
  2017-11-08 17:26 ` Loc Ho
  2017-11-09  0:17 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-11-08 12:08 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: Arnd Bergmann, Loc Ho, Mark Brown, linux-rtc, linux-kernel

The new xgene_rtc_alarm_irq_enabled() function is only accessed
from PM code, which is inside of an #ifdef; this causes a harmless
build warning when CONFIG_PM is disabled:

drivers/rtc/rtc-xgene.c:108:12: error: 'xgene_rtc_alarm_irq_enabled' defined but not used [-Werror=unused-function]

Just remove the #ifdef and use __maybe_unused annotations instead,
to make the code more robust here.

Fixes: 9f8f1c8b727d ("rtc: Fix suspend/resume for APM X-Gene SoC RTC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/rtc/rtc-xgene.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c
index 360eae24a8c8..0c34d3b81279 100644
--- a/drivers/rtc/rtc-xgene.c
+++ b/drivers/rtc/rtc-xgene.c
@@ -221,8 +221,7 @@ static int xgene_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int xgene_rtc_suspend(struct device *dev)
+static int __maybe_unused xgene_rtc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev);
@@ -246,7 +245,7 @@ static int xgene_rtc_suspend(struct device *dev)
 	return 0;
 }
 
-static int xgene_rtc_resume(struct device *dev)
+static int __maybe_unused xgene_rtc_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev);
@@ -271,7 +270,6 @@ static int xgene_rtc_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(xgene_rtc_pm_ops, xgene_rtc_suspend, xgene_rtc_resume);
 
-- 
2.9.0

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

* Re: [PATCH] rtc: x-gene: mark PM functions as __maybe_unused
  2017-11-08 12:08 [PATCH] rtc: x-gene: mark PM functions as __maybe_unused Arnd Bergmann
@ 2017-11-08 17:26 ` Loc Ho
  2017-11-09  0:17 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Loc Ho @ 2017-11-08 17:26 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alessandro Zummo, Alexandre Belloni, Mark Brown, linux-rtc,
	Linux Kernel Mailing List

Hi,

> The new xgene_rtc_alarm_irq_enabled() function is only accessed
> from PM code, which is inside of an #ifdef; this causes a harmless
> build warning when CONFIG_PM is disabled:
>
> drivers/rtc/rtc-xgene.c:108:12: error: 'xgene_rtc_alarm_irq_enabled' defined but not used [-Werror=unused-function]
>
> Just remove the #ifdef and use __maybe_unused annotations instead,
> to make the code more robust here.

It sounds like desire to merge in the suspend/resume support as this
is in linux-next 14 hours ago.

Reviewed-by: Loc Ho <lho@apm.com>

-Loc

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

* Re: [PATCH] rtc: x-gene: mark PM functions as __maybe_unused
  2017-11-08 12:08 [PATCH] rtc: x-gene: mark PM functions as __maybe_unused Arnd Bergmann
  2017-11-08 17:26 ` Loc Ho
@ 2017-11-09  0:17 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2017-11-09  0:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alessandro Zummo, Loc Ho, Mark Brown, linux-rtc, linux-kernel

On 08/11/2017 at 13:08:10 +0100, Arnd Bergmann wrote:
> The new xgene_rtc_alarm_irq_enabled() function is only accessed
> from PM code, which is inside of an #ifdef; this causes a harmless
> build warning when CONFIG_PM is disabled:
> 
> drivers/rtc/rtc-xgene.c:108:12: error: 'xgene_rtc_alarm_irq_enabled' defined but not used [-Werror=unused-function]
> 
> Just remove the #ifdef and use __maybe_unused annotations instead,
> to make the code more robust here.
> 
> Fixes: 9f8f1c8b727d ("rtc: Fix suspend/resume for APM X-Gene SoC RTC driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/rtc/rtc-xgene.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-11-09  0:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 12:08 [PATCH] rtc: x-gene: mark PM functions as __maybe_unused Arnd Bergmann
2017-11-08 17:26 ` Loc Ho
2017-11-09  0:17 ` Alexandre Belloni

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).