Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kselftest/arm64: Use the tools/include compiler.h rather than our own

The BTI test program started life as standalone programs outside the
kselftest suite so provided it's own compiler.h. Now that we have updated
the tools/include compiler.h to have all the definitions that we are using
and the arm64 selftsets pull in tools/includes let's drop our custom
version.

__unreachable() is named unreachable() there requiring an update in the
code.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230728-arm64-signal-memcpy-fix-v4-6-0c1290db5d46@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Mark Brown and committed by
Will Deacon
672dbf97 db7a89f7

+3 -27
-21
tools/testing/selftests/arm64/bti/compiler.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (C) 2019 Arm Limited 4 - * Original author: Dave Martin <Dave.Martin@arm.com> 5 - */ 6 - 7 - #ifndef COMPILER_H 8 - #define COMPILER_H 9 - 10 - #define __always_unused __attribute__((__unused__)) 11 - #define __noreturn __attribute__((__noreturn__)) 12 - #define __unreachable() __builtin_unreachable() 13 - 14 - /* curse(e) has value e, but the compiler cannot assume so */ 15 - #define curse(e) ({ \ 16 - __typeof__(e) __curse_e = (e); \ 17 - asm ("" : "+r" (__curse_e)); \ 18 - __curse_e; \ 19 - }) 20 - 21 - #endif /* ! COMPILER_H */
+1 -3
tools/testing/selftests/arm64/bti/system.c
··· 8 8 9 9 #include <asm/unistd.h> 10 10 11 - #include "compiler.h" 12 - 13 11 void __noreturn exit(int n) 14 12 { 15 13 syscall(__NR_exit, n); 16 - __unreachable(); 14 + unreachable(); 17 15 } 18 16 19 17 ssize_t write(int fd, const void *buf, size_t size)
+2 -2
tools/testing/selftests/arm64/bti/system.h
··· 14 14 typedef __kernel_ssize_t ssize_t; 15 15 16 16 #include <linux/errno.h> 17 + #include <linux/compiler.h> 18 + 17 19 #include <asm/hwcap.h> 18 20 #include <asm/ptrace.h> 19 21 #include <asm/unistd.h> 20 - 21 - #include "compiler.h" 22 22 23 23 long syscall(int nr, ...); 24 24
-1
tools/testing/selftests/arm64/bti/test.c
··· 17 17 typedef struct ucontext ucontext_t; 18 18 19 19 #include "btitest.h" 20 - #include "compiler.h" 21 20 #include "signal.h" 22 21 23 22 #define EXPECTED_TESTS 18