[PATCH] Mark inline functions as __maybe_unused

From: Behan Webster
Date: Wed Jan 28 2015 - 00:26:37 EST


clang warns if inline functions aren't used. By making them __maybe_unused
there is no warning for either gcc nor clang.

Signed-off-by: Behan Webster <behanw@xxxxxxxxxxxxxxxxxx>
Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: "Christopher Li" <sparse@xxxxxxxxxxx>
---
include/linux/compiler-gcc.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 02ae99e..c7b98fb 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -53,14 +53,14 @@
*/
#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)) notrace __maybe_unused
+# define __inline__ __inline__ __attribute__((always_inline)) notrace __maybe_unused
+# define __inline __inline __attribute__((always_inline)) notrace __maybe_unused
#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 notrace __maybe_unused
+# define __inline__ __inline__ notrace __maybe_unused
+# define __inline __inline notrace __maybe_unused
#endif

#define __deprecated __attribute__((deprecated))
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/