diff options
Diffstat (limited to 'fs/xfs/support/debug.h')
-rw-r--r-- | fs/xfs/support/debug.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h index 4f54dca662a8..2a70cc605ae3 100644 --- a/fs/xfs/support/debug.h +++ b/fs/xfs/support/debug.h | |||
@@ -38,13 +38,37 @@ extern void assfail(char *expr, char *f, int l); | |||
38 | 38 | ||
39 | #ifndef DEBUG | 39 | #ifndef DEBUG |
40 | # define ASSERT(expr) ((void)0) | 40 | # define ASSERT(expr) ((void)0) |
41 | #else | 41 | |
42 | #ifndef STATIC | ||
43 | # define STATIC static noinline | ||
44 | #endif | ||
45 | |||
46 | #ifndef STATIC_INLINE | ||
47 | # define STATIC_INLINE static inline | ||
48 | #endif | ||
49 | |||
50 | #else /* DEBUG */ | ||
51 | |||
42 | # define ASSERT(expr) ASSERT_ALWAYS(expr) | 52 | # define ASSERT(expr) ASSERT_ALWAYS(expr) |
43 | extern unsigned long random(void); | 53 | extern unsigned long random(void); |
44 | #endif | ||
45 | 54 | ||
46 | #ifndef STATIC | 55 | #ifndef STATIC |
47 | # define STATIC static | 56 | # define STATIC noinline |
48 | #endif | 57 | #endif |
49 | 58 | ||
59 | /* | ||
60 | * We stop inlining of inline functions in debug mode. | ||
61 | * Unfortunately, this means static inline in header files | ||
62 | * get multiple definitions, so they need to remain static. | ||
63 | * This then gives tonnes of warnings about unused but defined | ||
64 | * functions, so we need to add the unused attribute to prevent | ||
65 | * these spurious warnings. | ||
66 | */ | ||
67 | #ifndef STATIC_INLINE | ||
68 | # define STATIC_INLINE static __attribute__ ((unused)) noinline | ||
69 | #endif | ||
70 | |||
71 | #endif /* DEBUG */ | ||
72 | |||
73 | |||
50 | #endif /* __XFS_SUPPORT_DEBUG_H__ */ | 74 | #endif /* __XFS_SUPPORT_DEBUG_H__ */ |