diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index e4f142c5564d..1c0864de00eb 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -33,6 +33,13 @@ #define __SANITIZE_ADDRESS__ #endif +/* + * GCC does not warn about unused static inline functions for + * -Wunused-function. This turns out to avoid the need for complex #ifdef + * directives. Suppress the warning in clang as well. + */ +#define inline inline __attribute__((unused)) + /* Clang doesn't have a way to turn it off per-function, yet. */ #ifdef __noretpoline #undef __noretpoline