Skip to content

Commit 7f34b43

Browse files
arndbctmarinas
authored andcommitted
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: bd09128 ("arm64: Add percpu vectors for EL1") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: James Morse <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 09688c0 commit 7f34b43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/include/asm/vectors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors {
5656
DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector);
5757

5858
#ifndef CONFIG_UNMAP_KERNEL_AT_EL0
59-
#define TRAMP_VALIAS 0
59+
#define TRAMP_VALIAS 0ul
6060
#endif
6161

6262
static inline const char *
6363
arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot)
6464
{
6565
if (arm64_kernel_unmapped_at_el0())
66-
return (char *)TRAMP_VALIAS + SZ_2K * slot;
66+
return (char *)(TRAMP_VALIAS + SZ_2K * slot);
6767

6868
WARN_ON_ONCE(slot == EL1_VECTOR_KPTI);
6969

0 commit comments

Comments
 (0)