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

tools include: Add some common function attributes

We don't have definitions of __always_unused or __noreturn in the tools
version of compiler.h, add them so we can use them in kselftests.

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

authored by

Mark Brown and committed by
Will Deacon
51e6ac1f e5d51a66

+12
+12
tools/include/linux/compiler.h
··· 42 42 # define __always_inline inline __attribute__((always_inline)) 43 43 #endif 44 44 45 + #ifndef __always_unused 46 + #define __always_unused __attribute__((__unused__)) 47 + #endif 48 + 49 + #ifndef __noreturn 50 + #define __noreturn __attribute__((__noreturn__)) 51 + #endif 52 + 53 + #ifndef unreachable 54 + #define unreachable() __builtin_unreachable() 55 + #endif 56 + 45 57 #ifndef noinline 46 58 #define noinline 47 59 #endif