Commit 7f34b43e authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Catalin Marinas

arm64: fix clang warning about TRAMP_VALIAS

The newly introduced TRAMP_VALIAS definition causes a build warning
with clang-14:

arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic]
                return (char *)TRAMP_VALIAS + SZ_2K * slot;

Change the addition to something clang does not complain about.

Fixes: bd09128d ("arm64: Add percpu vectors for EL1")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarJames Morse <james.morse@arm.com>
Link: https://lore.kernel.org/r/20220316183833.1563139-1-arnd@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 09688c01
...@@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors { ...@@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors {
DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector); DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector);
#ifndef CONFIG_UNMAP_KERNEL_AT_EL0 #ifndef CONFIG_UNMAP_KERNEL_AT_EL0
#define TRAMP_VALIAS 0 #define TRAMP_VALIAS 0ul
#endif #endif
static inline const char * static inline const char *
arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot) arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot)
{ {
if (arm64_kernel_unmapped_at_el0()) if (arm64_kernel_unmapped_at_el0())
return (char *)TRAMP_VALIAS + SZ_2K * slot; return (char *)(TRAMP_VALIAS + SZ_2K * slot);
WARN_ON_ONCE(slot == EL1_VECTOR_KPTI); WARN_ON_ONCE(slot == EL1_VECTOR_KPTI);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment