summaryrefslogtreecommitdiff
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2024-11-28 10:39:01 +0100
committerPeter Zijlstra <peterz@infradead.org>2024-12-02 12:01:43 +0100
commitc837de3810982cd41cd70e5170da1931439f025c (patch)
treee0dad45f10e8c9d2db3ac00dfd2499fdd474b8c0 /include/linux/compiler.h
parentbb8170067470cc7af28e4386e600b1e0a6a8956a (diff)
unreachable: Unify
Since barrier_before_unreachable() is empty for !GCC it is trivial to unify the two definitions. Less is more. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://lore.kernel.org/r/20241128094311.924381359@infradead.org
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 469a64dd6495..7be80897a62f 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -141,12 +141,16 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
#define __annotate_jump_table
#endif /* CONFIG_OBJTOOL */
-#ifndef unreachable
-# define unreachable() do { \
+/*
+ * Mark a position in code as unreachable. This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ */
+#define unreachable() do { \
annotate_unreachable(); \
+ barrier_before_unreachable(); \
__builtin_unreachable(); \
} while (0)
-#endif
/*
* KENTRY - kernel entry point