diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 65246758..8d22d296 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 8a9ac857..e9a2ce45 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