]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/support/debug.h
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[linux-2.6-omap-h63xx.git] / fs / xfs / support / debug.h
index 4f54dca662a89ca646f9ff27a51d129a1c42a4de..2a70cc605ae34b5298ed8e4ebd0a912d9153fd37 100644 (file)
@@ -38,13 +38,37 @@ extern void assfail(char *expr, char *f, int l);
 
 #ifndef DEBUG
 # define ASSERT(expr)  ((void)0)
-#else
+
+#ifndef STATIC
+# define STATIC static noinline
+#endif
+
+#ifndef STATIC_INLINE
+# define STATIC_INLINE static inline
+#endif
+
+#else /* DEBUG */
+
 # define ASSERT(expr)  ASSERT_ALWAYS(expr)
 extern unsigned long random(void);
-#endif
 
 #ifndef STATIC
-# define STATIC static
+# define STATIC noinline
 #endif
 
+/*
+ * We stop inlining of inline functions in debug mode.
+ * Unfortunately, this means static inline in header files
+ * get multiple definitions, so they need to remain static.
+ * This then gives tonnes of warnings about unused but defined
+ * functions, so we need to add the unused attribute to prevent
+ * these spurious warnings.
+ */
+#ifndef STATIC_INLINE
+# define STATIC_INLINE static __attribute__ ((unused)) noinline
+#endif
+
+#endif /* DEBUG */
+
+
 #endif  /* __XFS_SUPPORT_DEBUG_H__ */