All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM64: mark cpus_have_hwcap as __maybe_unused
@ 2015-11-12 14:20 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2015-11-12 14:20 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: linux-arm-kernel, linux-kernel, Suzuki K. Poulose

cpus_have_hwcap() is defined as a 'static' function an only used in
one place that is inside of an #ifdef, so we get a warning when
the only user is disabled:

arch/arm64/kernel/cpufeature.c:699:13: warning: 'cpus_have_hwcap' defined but not used [-Wunused-function]

This marks the function as __maybe_unused, so the compiler knows that
it can drop the function definition without warning about it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 37b01d53ceef ("arm64/HWCAP: Use system wide safe values")
---
Found on arm64 allnoconfig

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 52f0d7a5a1c2..c8cf89223b5a 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -696,7 +696,7 @@ static void cap_set_hwcap(const struct arm64_cpu_capabilities *cap)
 }
 
 /* Check if we have a particular HWCAP enabled */
-static bool cpus_have_hwcap(const struct arm64_cpu_capabilities *cap)
+static bool __maybe_unused cpus_have_hwcap(const struct arm64_cpu_capabilities *cap)
 {
 	bool rc;
 


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

* [PATCH] ARM64: mark cpus_have_hwcap as __maybe_unused
@ 2015-11-12 14:20 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2015-11-12 14:20 UTC (permalink / raw)
  To: linux-arm-kernel

cpus_have_hwcap() is defined as a 'static' function an only used in
one place that is inside of an #ifdef, so we get a warning when
the only user is disabled:

arch/arm64/kernel/cpufeature.c:699:13: warning: 'cpus_have_hwcap' defined but not used [-Wunused-function]

This marks the function as __maybe_unused, so the compiler knows that
it can drop the function definition without warning about it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 37b01d53ceef ("arm64/HWCAP: Use system wide safe values")
---
Found on arm64 allnoconfig

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 52f0d7a5a1c2..c8cf89223b5a 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -696,7 +696,7 @@ static void cap_set_hwcap(const struct arm64_cpu_capabilities *cap)
 }
 
 /* Check if we have a particular HWCAP enabled */
-static bool cpus_have_hwcap(const struct arm64_cpu_capabilities *cap)
+static bool __maybe_unused cpus_have_hwcap(const struct arm64_cpu_capabilities *cap)
 {
 	bool rc;
 

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

* Re: [PATCH] ARM64: mark cpus_have_hwcap as __maybe_unused
  2015-11-12 14:20 ` Arnd Bergmann
@ 2015-11-12 14:57   ` Catalin Marinas
  -1 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2015-11-12 14:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Will Deacon, linux-kernel, linux-arm-kernel, Suzuki K. Poulose

On Thu, Nov 12, 2015 at 03:20:16PM +0100, Arnd Bergmann wrote:
> cpus_have_hwcap() is defined as a 'static' function an only used in
> one place that is inside of an #ifdef, so we get a warning when
> the only user is disabled:
> 
> arch/arm64/kernel/cpufeature.c:699:13: warning: 'cpus_have_hwcap' defined but not used [-Wunused-function]
> 
> This marks the function as __maybe_unused, so the compiler knows that
> it can drop the function definition without warning about it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 37b01d53ceef ("arm64/HWCAP: Use system wide safe values")
> ---
> Found on arm64 allnoconfig

I applied this patch and the other two you just posted. Thanks.

-- 
Catalin

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

* [PATCH] ARM64: mark cpus_have_hwcap as __maybe_unused
@ 2015-11-12 14:57   ` Catalin Marinas
  0 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2015-11-12 14:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 12, 2015 at 03:20:16PM +0100, Arnd Bergmann wrote:
> cpus_have_hwcap() is defined as a 'static' function an only used in
> one place that is inside of an #ifdef, so we get a warning when
> the only user is disabled:
> 
> arch/arm64/kernel/cpufeature.c:699:13: warning: 'cpus_have_hwcap' defined but not used [-Wunused-function]
> 
> This marks the function as __maybe_unused, so the compiler knows that
> it can drop the function definition without warning about it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 37b01d53ceef ("arm64/HWCAP: Use system wide safe values")
> ---
> Found on arm64 allnoconfig

I applied this patch and the other two you just posted. Thanks.

-- 
Catalin

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

end of thread, other threads:[~2015-11-12 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 14:20 [PATCH] ARM64: mark cpus_have_hwcap as __maybe_unused Arnd Bergmann
2015-11-12 14:20 ` Arnd Bergmann
2015-11-12 14:57 ` Catalin Marinas
2015-11-12 14:57   ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.