* [PATCH] rtc: meson: mark PM functions as __maybe_unused
@ 2019-09-06 15:24 Arnd Bergmann
2019-09-06 16:56 ` Kevin Hilman
2019-09-10 14:15 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-09-06 15:24 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, Kevin Hilman
Cc: Arnd Bergmann, Neil Armstrong, linux-rtc, linux-arm-kernel,
linux-amlogic, linux-kernel
The meson_vrtc_set_wakeup_time() function is only used by
the PM functions and causes a warning when they are disabled:
drivers/rtc/rtc-meson-vrtc.c:32:13: error: unused function 'meson_vrtc_set_wakeup_time' [-Werror,-Wunused-function]
Remove the #ifdef around the callers and add a __maybe_unused
annotation as a more reliable way to avoid these warnings.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/rtc/rtc-meson-vrtc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-meson-vrtc.c b/drivers/rtc/rtc-meson-vrtc.c
index 4621a4715179..89e5ba0dae69 100644
--- a/drivers/rtc/rtc-meson-vrtc.c
+++ b/drivers/rtc/rtc-meson-vrtc.c
@@ -91,8 +91,7 @@ static int meson_vrtc_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int meson_vrtc_suspend(struct device *dev)
+static int __maybe_unused meson_vrtc_suspend(struct device *dev)
{
struct meson_vrtc_data *vrtc = dev_get_drvdata(dev);
@@ -121,7 +120,7 @@ static int meson_vrtc_suspend(struct device *dev)
return 0;
}
-static int meson_vrtc_resume(struct device *dev)
+static int __maybe_unused meson_vrtc_resume(struct device *dev)
{
struct meson_vrtc_data *vrtc = dev_get_drvdata(dev);
@@ -131,7 +130,7 @@ static int meson_vrtc_resume(struct device *dev)
meson_vrtc_set_wakeup_time(vrtc, 0);
return 0;
}
-#endif
+
static SIMPLE_DEV_PM_OPS(meson_vrtc_pm_ops,
meson_vrtc_suspend, meson_vrtc_resume);
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: meson: mark PM functions as __maybe_unused
2019-09-06 15:24 [PATCH] rtc: meson: mark PM functions as __maybe_unused Arnd Bergmann
@ 2019-09-06 16:56 ` Kevin Hilman
2019-09-10 14:15 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2019-09-06 16:56 UTC (permalink / raw)
To: Arnd Bergmann, Alessandro Zummo, Alexandre Belloni
Cc: Arnd Bergmann, Neil Armstrong, linux-rtc, linux-arm-kernel,
linux-amlogic, linux-kernel
Arnd Bergmann <arnd@arndb.de> writes:
> The meson_vrtc_set_wakeup_time() function is only used by
> the PM functions and causes a warning when they are disabled:
>
> drivers/rtc/rtc-meson-vrtc.c:32:13: error: unused function 'meson_vrtc_set_wakeup_time' [-Werror,-Wunused-function]
>
> Remove the #ifdef around the callers and add a __maybe_unused
> annotation as a more reliable way to avoid these warnings.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: meson: mark PM functions as __maybe_unused
2019-09-06 15:24 [PATCH] rtc: meson: mark PM functions as __maybe_unused Arnd Bergmann
2019-09-06 16:56 ` Kevin Hilman
@ 2019-09-10 14:15 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2019-09-10 14:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alessandro Zummo, Kevin Hilman, Neil Armstrong, linux-rtc,
linux-arm-kernel, linux-amlogic, linux-kernel
On 06/09/2019 17:24:29+0200, Arnd Bergmann wrote:
> The meson_vrtc_set_wakeup_time() function is only used by
> the PM functions and causes a warning when they are disabled:
>
> drivers/rtc/rtc-meson-vrtc.c:32:13: error: unused function 'meson_vrtc_set_wakeup_time' [-Werror,-Wunused-function]
>
> Remove the #ifdef around the callers and add a __maybe_unused
> annotation as a more reliable way to avoid these warnings.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/rtc/rtc-meson-vrtc.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
Applied, thanks.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-10 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 15:24 [PATCH] rtc: meson: mark PM functions as __maybe_unused Arnd Bergmann
2019-09-06 16:56 ` Kevin Hilman
2019-09-10 14:15 ` 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).