diff options
Diffstat (limited to 'include/linux/arcdevice.h')
-rw-r--r-- | include/linux/arcdevice.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 78687885eb81..ad610208fbba 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
@@ -78,14 +78,24 @@ | |||
78 | #endif | 78 | #endif |
79 | extern int arcnet_debug; | 79 | extern int arcnet_debug; |
80 | 80 | ||
81 | #define BUGLVL_TEST(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug) | ||
82 | #define BUGLVL(x) if (BUGLVL_TEST(x)) | ||
83 | |||
81 | /* macros to simplify debug checking */ | 84 | /* macros to simplify debug checking */ |
82 | #define BUGLVL(x) if ((ARCNET_DEBUG_MAX) & arcnet_debug & (x)) | 85 | #define BUGMSG(x, fmt, ...) \ |
83 | #define BUGMSG2(x, msg, args...) do { BUGLVL(x) printk(msg, ## args); } while (0) | 86 | do { \ |
84 | #define BUGMSG(x, msg, args...) \ | 87 | if (BUGLVL_TEST(x)) \ |
85 | BUGMSG2(x, "%s%6s: " msg, \ | 88 | printk("%s%6s: " fmt, \ |
86 | x == D_NORMAL ? KERN_WARNING \ | 89 | (x) == D_NORMAL ? KERN_WARNING : \ |
87 | : x < D_DURING ? KERN_INFO : KERN_DEBUG, \ | 90 | (x) < D_DURING ? KERN_INFO : KERN_DEBUG, \ |
88 | dev->name, ## args) | 91 | dev->name, ##__VA_ARGS__); \ |
92 | } while (0) | ||
93 | |||
94 | #define BUGMSG2(x, fmt, ...) \ | ||
95 | do { \ | ||
96 | if (BUGLVL_TEST(x)) \ | ||
97 | printk(fmt, ##__VA_ARGS__); \ | ||
98 | } while (0) | ||
89 | 99 | ||
90 | /* see how long a function call takes to run, expressed in CPU cycles */ | 100 | /* see how long a function call takes to run, expressed in CPU cycles */ |
91 | #define TIME(name, bytes, call) BUGLVL(D_TIMING) { \ | 101 | #define TIME(name, bytes, call) BUGLVL(D_TIMING) { \ |