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


Groups > linux.kernel > #1322989 > unrolled thread

[PATCH] PM / Domains: mark genpd_poweron as __maybe_unused

Started byArnd Bergmann <arnd@arndb.de>
First post2016-02-01 12:00 +0100
Last post2016-02-01 15:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PM / Domains: mark genpd_poweron as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2016-02-01 12:00 +0100
    Re: [PATCH] PM / Domains: mark genpd_poweron as __maybe_unused Ulf Hansson <ulf.hansson@linaro.org> - 2016-02-01 15:00 +0100

#1322989 — [PATCH] PM / Domains: mark genpd_poweron as __maybe_unused

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-01 12:00 +0100
Subject[PATCH] PM / Domains: mark genpd_poweron as __maybe_unused
Message-ID<qXkn7-1my-3@gated-at.bofh.it>
The rework of the power domain code has made the genpd_poweron()
function local to the file it's defined in, and the only remaining
caller is conditionally compiled based on CONFIG_PM_GENERIC_DOMAINS_OF,
so we get a warning when that is disabled:

drivers/base/power/domain.c:234:12: error: 'genpd_poweron' defined but not used [-Werror=unused-function]

This adds a __maybe_unused annotation to the function so gcc can
figure out by itself that it should silently remove the definition
in this case.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: ea823c7cbffa ("PM / Domains: Remove pm_genpd_poweron() API")

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 784dbe897a5e..a14b2f1ae085 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -231,7 +231,7 @@ static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
  * genpd_poweron - Restore power to a given PM domain and its masters.
  * @genpd: PM domain to power up.
  */
-static int genpd_poweron(struct generic_pm_domain *genpd)
+static int __maybe_unused genpd_poweron(struct generic_pm_domain *genpd)
 {
 	int ret;
 

[toc] | [next] | [standalone]


#1323135

FromUlf Hansson <ulf.hansson@linaro.org>
Date2016-02-01 15:00 +0100
Message-ID<qXnbk-3DE-11@gated-at.bofh.it>
In reply to#1322989
On 1 February 2016 at 11:38, Arnd Bergmann <arnd@arndb.de> wrote:
> The rework of the power domain code has made the genpd_poweron()
> function local to the file it's defined in, and the only remaining
> caller is conditionally compiled based on CONFIG_PM_GENERIC_DOMAINS_OF,
> so we get a warning when that is disabled:
>
> drivers/base/power/domain.c:234:12: error: 'genpd_poweron' defined but not used [-Werror=unused-function]
>
> This adds a __maybe_unused annotation to the function so gcc can
> figure out by itself that it should silently remove the definition
> in this case.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: ea823c7cbffa ("PM / Domains: Remove pm_genpd_poweron() API")

Arnd,

Thanks for fixing and reporting!

Looking a bit closer to the genpd code in this reagrds, made me
realize that I think there's a better approach to fix this.
Instead of going into the details for how, I decided to send a
separate patch. You are on cc.

"[PATCH] PM / Domains: Silence compiler warning for an unused function".

Kind regards
Uffe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web