ARM64: mark cpus_have_hwcap as __maybe_unused
PATCH 1/1 ARM64: mark cpus_have_hwcap as __maybe_unused
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.
---
Found on arm64 allnoconfig
arch/arm64/kernel/cpufeature.c +1 -1
@@ -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;
Quoted 6 lines · Arnd Bergmann
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]
Quoted 7 lines
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 <[email protected]>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.
Signature · 1 line
Catalin