diff options
author | Will Deacon <will.deacon@arm.com> | 2018-03-27 13:51:12 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-03-27 13:51:12 +0300 |
commit | 12eb369125abe92bfc55e9ce198200f5807b63ff (patch) | |
tree | 2bd72a29d66bf9de8452a6e4415981c7f60b15ef /arch/arm64/kernel/cpufeature.c | |
parent | ece1397cbc89c51914fae1aec729539cfd8bd62b (diff) | |
download | linux-12eb369125abe92bfc55e9ce198200f5807b63ff.tar.xz |
arm64: cpufeature: Avoid warnings due to unused symbols
An allnoconfig build complains about unused symbols due to functions
that are called via conditional cpufeature and cpu_errata table entries.
Annotate these as __maybe_unused if they are likely to be generic, or
predicate their compilation on the same option as the table entry if
they are specific to a given alternative.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/cpufeature.c')
-rw-r--r-- | arch/arm64/kernel/cpufeature.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 381bb4077563..071a4548a231 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -838,11 +838,6 @@ static bool has_no_hw_prefetch(const struct arm64_cpu_capabilities *entry, int _ MIDR_CPU_VAR_REV(1, MIDR_REVISION_MASK)); } -static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused) -{ - return is_kernel_in_hyp_mode(); -} - static bool hyp_offset_low(const struct arm64_cpu_capabilities *entry, int __unused) { @@ -1022,6 +1017,12 @@ static bool has_hw_dbm(const struct arm64_cpu_capabilities *cap, #endif +#ifdef CONFIG_ARM64_VHE +static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused) +{ + return is_kernel_in_hyp_mode(); +} + static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) { /* @@ -1035,6 +1036,7 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) if (!alternatives_applied) write_sysreg(read_sysreg(tpidr_el1), tpidr_el2); } +#endif static const struct arm64_cpu_capabilities arm64_features[] = { { |