aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Monnet <quentin@isovalent.com>2023-08-29 09:56:13 +0100
committerQuentin Monnet <qmonnet+github@qoba.lt>2023-08-29 12:34:13 +0100
commit654895b9fd4706586614be88a56eb593d1b2dc92 (patch)
treed55c9b0800b763c125709567615d0a09884d03dd
parent5dc1ec58fbe1aad4c889b56b124a271557edc223 (diff)
downloadbpftool-654895b9fd4706586614be88a56eb593d1b2dc92.tar.gz
mirror: Update "fallthrough" keyword definition
To align on the rest of the kernel code, we updated the "__fallthrough" keyword into simply "fallthrough". The change needs the corresponding definition in the headers. Signed-off-by: Quentin Monnet <quentin@isovalent.com>
-rw-r--r--include/linux/compiler-gcc.h6
-rw-r--r--include/linux/compiler.h4
2 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 6524675..8d22d29 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -13,8 +13,10 @@
+ __GNUC_PATCHLEVEL__)
#endif
-#if GCC_VERSION >= 70000 && !defined(__CHECKER__)
-# define __fallthrough __attribute__ ((fallthrough))
+#if __has_attribute(__fallthrough__)
+# define fallthrough __attribute__((__fallthrough__))
+#else
+# define fallthrough do {} while (0) /* fallthrough */
#endif
#if __has_attribute(__error__)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8a9ac85..e9a2ce4 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -44,8 +44,4 @@
# define __weak __attribute__((weak))
#endif
-#ifndef __fallthrough
-# define __fallthrough
-#endif
-
#endif