Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626661 > unrolled thread

[PATCH] rtc: sh: mark PM functions as unused

Started byArnd Bergmann <arnd@arndb.de>
First post2017-04-19 20:00 +0200
Last post2017-04-22 18:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] rtc: sh: mark PM functions as unused Arnd Bergmann <arnd@arndb.de> - 2017-04-19 20:00 +0200
    Re: [PATCH] rtc: sh: mark PM functions as unused Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-04-22 18:10 +0200

#1626661 — [PATCH] rtc: sh: mark PM functions as unused

FromArnd Bergmann <arnd@arndb.de>
Date2017-04-19 20:00 +0200
Subject[PATCH] rtc: sh: mark PM functions as unused
Message-ID<ty23v-6o6-19@gated-at.bofh.it>
The sh_rtc_set_irq_wake() function is only called from the suspend/resume handlers
that may be hidden, causing a harmless warning:

drivers/rtc/rtc-sh.c:724:13: error: 'sh_rtc_set_irq_wake' defined but not used [-Werror=unused-function]
 static void sh_rtc_set_irq_wake(struct device *dev, int enabled)

The most reliable way to avoid the warning is to remove the existing #ifdef
and mark the two functions as __maybe_unused so the compiler can silently
drop all three when there is no reference.

Fixes: dab5aec64bf5 ("rtc: sh: add support for rza series")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/rtc/rtc-sh.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 00b396e96cbe..6c2d3989f967 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -734,8 +734,7 @@ static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int sh_rtc_suspend(struct device *dev)
+static int __maybe_unused sh_rtc_suspend(struct device *dev)
 {
 	if (device_may_wakeup(dev))
 		sh_rtc_set_irq_wake(dev, 1);
@@ -743,14 +742,13 @@ static int sh_rtc_suspend(struct device *dev)
 	return 0;
 }
 
-static int sh_rtc_resume(struct device *dev)
+static int __maybe_unused sh_rtc_resume(struct device *dev)
 {
 	if (device_may_wakeup(dev))
 		sh_rtc_set_irq_wake(dev, 0);
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
-- 
2.9.0

[toc] | [next] | [standalone]


#1628863

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2017-04-22 18:10 +0200
Message-ID<tz5LH-50r-7@gated-at.bofh.it>
In reply to#1626661
On 19/04/2017 at 19:52:43 +0200, Arnd Bergmann wrote:
> The sh_rtc_set_irq_wake() function is only called from the suspend/resume handlers
> that may be hidden, causing a harmless warning:
> 
> drivers/rtc/rtc-sh.c:724:13: error: 'sh_rtc_set_irq_wake' defined but not used [-Werror=unused-function]
>  static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
> 
> The most reliable way to avoid the warning is to remove the existing #ifdef
> and mark the two functions as __maybe_unused so the compiler can silently
> drop all three when there is no reference.
> 
> Fixes: dab5aec64bf5 ("rtc: sh: add support for rza series")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/rtc/rtc-sh.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
Applied, thanks.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web