diff options
author | Joe Perches <joe@perches.com> | 2012-12-05 15:42:47 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-12-05 15:58:09 -0500 |
commit | bde98197310fd085ee4bb00ab310abcbe55b0664 (patch) | |
tree | ea71c07f4b227c559ca121753b6b2e463c0b30b9 /fs/cifs/cifs_debug.h | |
parent | 52c0f4ad8ed462d81f1d37f56a74a71dc0c9bf0f (diff) |
cifs: Make CIFS_DEBUG possible to undefine
Make the compilation work again when CIFS_DEBUG is not #define'd.
Add format and argument verification for the various macros when
CIFS_DEBUG is not #define'd.
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/cifs/cifs_debug.h')
-rw-r--r-- | fs/cifs/cifs_debug.h | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index b0fc344eb857..4d12fe48fb50 100644 --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h | |||
@@ -37,6 +37,9 @@ void dump_smb(void *, int); | |||
37 | #define CIFS_RC 0x02 | 37 | #define CIFS_RC 0x02 |
38 | #define CIFS_TIMER 0x04 | 38 | #define CIFS_TIMER 0x04 |
39 | 39 | ||
40 | extern int cifsFYI; | ||
41 | extern int cifsERROR; | ||
42 | |||
40 | /* | 43 | /* |
41 | * debug ON | 44 | * debug ON |
42 | * -------- | 45 | * -------- |
@@ -44,36 +47,33 @@ void dump_smb(void *, int); | |||
44 | #ifdef CIFS_DEBUG | 47 | #ifdef CIFS_DEBUG |
45 | 48 | ||
46 | /* information message: e.g., configuration, major event */ | 49 | /* information message: e.g., configuration, major event */ |
47 | extern int cifsFYI; | 50 | #define cifsfyi(fmt, ...) \ |
48 | #define cifsfyi(fmt, arg...) \ | ||
49 | do { \ | 51 | do { \ |
50 | if (cifsFYI & CIFS_INFO) \ | 52 | if (cifsFYI & CIFS_INFO) \ |
51 | printk(KERN_DEBUG "%s: " fmt "\n", __FILE__, ##arg); \ | 53 | printk(KERN_DEBUG "%s: " fmt "\n", \ |
54 | __FILE__, ##__VA_ARGS__); \ | ||
52 | } while (0) | 55 | } while (0) |
53 | 56 | ||
54 | #define cFYI(set, fmt, arg...) \ | 57 | #define cFYI(set, fmt, ...) \ |
55 | do { \ | 58 | do { \ |
56 | if (set) \ | 59 | if (set) \ |
57 | cifsfyi(fmt, ##arg); \ | 60 | cifsfyi(fmt, ##__VA_ARGS__); \ |
58 | } while (0) | 61 | } while (0) |
59 | 62 | ||
60 | #define cifswarn(fmt, arg...) \ | 63 | #define cifswarn(fmt, ...) \ |
61 | printk(KERN_WARNING fmt "\n", ##arg) | 64 | printk(KERN_WARNING fmt "\n", ##__VA_ARGS__) |
62 | |||
63 | /* debug event message: */ | ||
64 | extern int cifsERROR; | ||
65 | 65 | ||
66 | /* error event message: e.g., i/o error */ | 66 | /* error event message: e.g., i/o error */ |
67 | #define cifserror(fmt, arg...) \ | 67 | #define cifserror(fmt, ...) \ |
68 | do { \ | 68 | do { \ |
69 | if (cifsERROR) \ | 69 | if (cifsERROR) \ |
70 | printk(KERN_ERR "CIFS VFS: " fmt "\n", ##arg); \ | 70 | printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ |
71 | } while (0) | 71 | } while (0) |
72 | 72 | ||
73 | #define cERROR(set, fmt, arg...) \ | 73 | #define cERROR(set, fmt, ...) \ |
74 | do { \ | 74 | do { \ |
75 | if (set) \ | 75 | if (set) \ |
76 | cifserror(fmt, ##arg); \ | 76 | cifserror(fmt, ##__VA_ARGS__); \ |
77 | } while (0) | 77 | } while (0) |
78 | 78 | ||
79 | /* | 79 | /* |
@@ -81,9 +81,27 @@ do { \ | |||
81 | * --------- | 81 | * --------- |
82 | */ | 82 | */ |
83 | #else /* _CIFS_DEBUG */ | 83 | #else /* _CIFS_DEBUG */ |
84 | #define cERROR(set, fmt, arg...) | 84 | #define cifsfyi(fmt, ...) \ |
85 | #define cFYI(set, fmt, arg...) | 85 | do { \ |
86 | #define cifserror(fmt, arg...) | 86 | if (0) \ |
87 | printk(KERN_DEBUG "%s: " fmt "\n", \ | ||
88 | __FILE__, ##__VA_ARGS__); \ | ||
89 | } while (0) | ||
90 | #define cFYI(set, fmt, ...) \ | ||
91 | do { \ | ||
92 | if (0 && set) \ | ||
93 | cifsfyi(fmt, ##__VA_ARGS__); \ | ||
94 | } while (0) | ||
95 | #define cifserror(fmt, ...) \ | ||
96 | do { \ | ||
97 | if (0) \ | ||
98 | printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ | ||
99 | } while (0) | ||
100 | #define cERROR(set, fmt, ...) \ | ||
101 | do { \ | ||
102 | if (0 && set) \ | ||
103 | cifserror(fmt, ##__VA_ARGS__); \ | ||
104 | } while (0) | ||
87 | #endif /* _CIFS_DEBUG */ | 105 | #endif /* _CIFS_DEBUG */ |
88 | 106 | ||
89 | #endif /* _H_CIFS_DEBUG */ | 107 | #endif /* _H_CIFS_DEBUG */ |