* with any version that can compile the kernel
  */
 #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-
-/*
- * 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.
- */
-#undef inline
-#define inline inline __attribute__((unused)) notrace
 
 
 /*
  * Force always-inline if the user requests it so via the .config,
- * or if gcc is too old:
+ * or if gcc is too old.
+ * 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 by using "unused"
+ * function attribute, which is redundant but not harmful for gcc.
  */
 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) ||               \
     !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-#define inline         inline          __attribute__((always_inline)) notrace
-#define __inline__     __inline__      __attribute__((always_inline)) notrace
-#define __inline       __inline        __attribute__((always_inline)) notrace
+#define inline inline          __attribute__((always_inline,unused)) notrace
+#define __inline__ __inline__  __attribute__((always_inline,unused)) notrace
+#define __inline __inline      __attribute__((always_inline,unused)) notrace
 #else
 /* A lot of inline functions can cause havoc with function tracing */
-#define inline         inline          notrace
-#define __inline__     __inline__      notrace
-#define __inline       __inline        notrace
+#define inline inline          __attribute__((unused)) notrace
+#define __inline__ __inline__  __attribute__((unused)) notrace
+#define __inline __inline      __attribute__((unused)) notrace
 #endif
 
 #define __always_inline        inline __attribute__((always_inline))