Skip to content

Commit 51e6ac1

Browse files
brooniewilldeacon
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent e5d51a6 commit 51e6ac1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/include/linux/compiler.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@
4242
# define __always_inline inline __attribute__((always_inline))
4343
#endif
4444

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+
4557
#ifndef noinline
4658
#define noinline
4759
#endif

0 commit comments

Comments
 (0)