SUPERH platform development
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: apmu: silence build warnings
Date: Mon, 13 Jul 2015 01:04:06 +0000	[thread overview]
Message-ID: <20150713010406.GA25443@verge.net.au> (raw)
In-Reply-To: <1436561296-29141-1-git-send-email-wsa@the-dreams.de>

Hi Wolfram,

On Fri, Jul 10, 2015 at 10:48:16PM +0200, Wolfram Sang wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> With shmobile_defconfig but SMP=n && SUSPEND=n, I get:
> 
> arch/arm/mach-shmobile/platsmp-apmu.c:49:12: warning: 'apmu_power_off' defined but not used [-Wunused-function]
> arch/arm/mach-shmobile/platsmp-apmu.c:70:12: warning: 'apmu_wrap' defined but not used [-Wunused-function]
> 
> Annotate those functions like the functions around it.

thanks for noticing this.

I'm not familiar with when it is appropriate to use __maybe_unused but does
anything speak against using #if as per the conditional compilation of the
callers in platsmp-apmu.c of the above functions?

diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index b0790fc32282..54cf153b570f 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -46,12 +46,14 @@ static int __maybe_unused apmu_power_on(void __iomem *p, int bit)
 	return 0;
 }
 
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND)
 static int apmu_power_off(void __iomem *p, int bit)
 {
 	/* request Core Standby for next WFI */
 	writel_relaxed(3, p + CPUNCR_OFFS(bit));
 	return 0;
 }
+#endif
 
 static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
 {
@@ -67,12 +69,14 @@ static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
 	return 0;
 }
 
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || defined(CONFIG_SMP)
 static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu))
 {
 	void __iomem *p = apmu_cpus[cpu].iomem;
 
 	return p ? fn(p, apmu_cpus[cpu].bit) : -EINVAL;
 }
+#endif
 
 static void apmu_init_cpu(struct resource *res, int cpu, int bit)
 {

  reply	other threads:[~2015-07-13  1:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 20:48 [PATCH] ARM: shmobile: apmu: silence build warnings Wolfram Sang
2015-07-13  1:04 ` Simon Horman [this message]
2015-07-13  8:58 ` Wolfram Sang
2015-07-14  7:35 ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2015-07-24  8:41 [GIT PULL] Second Round of Renesas ARM Based SoC Cleanup for v4.3 Simon Horman
2015-07-24  8:41 ` [PATCH] ARM: shmobile: apmu: silence build warnings Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150713010406.GA25443@verge.net.au \
    --to=horms@verge.net.au \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox