summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-12-05 12:42:47 -0800
committerSteve French <smfrench@gmail.com>2012-12-05 14:58:09 -0600
commitbde98197310fd085ee4bb00ab310abcbe55b0664 (patch)
treeea71c07f4b227c559ca121753b6b2e463c0b30b9 /fs/cifs
parent52c0f4ad8ed462d81f1d37f56a74a71dc0c9bf0f (diff)
downloadlinux-bde98197310fd085ee4bb00ab310abcbe55b0664.tar.bz2
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')
-rw-r--r--fs/cifs/cifs_debug.h64
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);
#define CIFS_RC 0x02
#define CIFS_TIMER 0x04
+extern int cifsFYI;
+extern int cifsERROR;
+
/*
* debug ON
* --------
@@ -44,36 +47,33 @@ void dump_smb(void *, int);
#ifdef CIFS_DEBUG
/* information message: e.g., configuration, major event */
-extern int cifsFYI;
-#define cifsfyi(fmt, arg...) \
+#define cifsfyi(fmt, ...) \
do { \
if (cifsFYI & CIFS_INFO) \
- printk(KERN_DEBUG "%s: " fmt "\n", __FILE__, ##arg); \
+ printk(KERN_DEBUG "%s: " fmt "\n", \
+ __FILE__, ##__VA_ARGS__); \
} while (0)
-#define cFYI(set, fmt, arg...) \
-do { \
- if (set) \
- cifsfyi(fmt, ##arg); \
+#define cFYI(set, fmt, ...) \
+do { \
+ if (set) \
+ cifsfyi(fmt, ##__VA_ARGS__); \
} while (0)
-#define cifswarn(fmt, arg...) \
- printk(KERN_WARNING fmt "\n", ##arg)
-
-/* debug event message: */
-extern int cifsERROR;
+#define cifswarn(fmt, ...) \
+ printk(KERN_WARNING fmt "\n", ##__VA_ARGS__)
/* error event message: e.g., i/o error */
-#define cifserror(fmt, arg...) \
-do { \
- if (cifsERROR) \
- printk(KERN_ERR "CIFS VFS: " fmt "\n", ##arg); \
+#define cifserror(fmt, ...) \
+do { \
+ if (cifsERROR) \
+ printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
} while (0)
-#define cERROR(set, fmt, arg...) \
-do { \
- if (set) \
- cifserror(fmt, ##arg); \
+#define cERROR(set, fmt, ...) \
+do { \
+ if (set) \
+ cifserror(fmt, ##__VA_ARGS__); \
} while (0)
/*
@@ -81,9 +81,27 @@ do { \
* ---------
*/
#else /* _CIFS_DEBUG */
-#define cERROR(set, fmt, arg...)
-#define cFYI(set, fmt, arg...)
-#define cifserror(fmt, arg...)
+#define cifsfyi(fmt, ...) \
+do { \
+ if (0) \
+ printk(KERN_DEBUG "%s: " fmt "\n", \
+ __FILE__, ##__VA_ARGS__); \
+} while (0)
+#define cFYI(set, fmt, ...) \
+do { \
+ if (0 && set) \
+ cifsfyi(fmt, ##__VA_ARGS__); \
+} while (0)
+#define cifserror(fmt, ...) \
+do { \
+ if (0) \
+ printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
+} while (0)
+#define cERROR(set, fmt, ...) \
+do { \
+ if (0 && set) \
+ cifserror(fmt, ##__VA_ARGS__); \
+} while (0)
#endif /* _CIFS_DEBUG */
#endif /* _H_CIFS_DEBUG */