From 176c9b3939d22bb1177eb15010e600bc59a1b0b5 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 29 Nov 2012 11:37:18 -0800 Subject: cifs: Remove unused cEVENT macro It uses an undefined KERN_EVENT and is itself unused. Signed-off-by: Joe Perches Reviewed-by: Jeff Layton Signed-off-by: Steve French Signed-off-by: Steve French --- fs/cifs/cifs_debug.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'fs/cifs/cifs_debug.h') diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index c0c68bb492d..b0fc344eb85 100644 --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h @@ -63,12 +63,6 @@ do { \ /* debug event message: */ extern int cifsERROR; -#define cEVENT(fmt, arg...) \ -do { \ - if (cifsERROR) \ - printk(KERN_EVENT "%s: " fmt "\n", __FILE__, ##arg); \ -} while (0) - /* error event message: e.g., i/o error */ #define cifserror(fmt, arg...) \ do { \ @@ -88,7 +82,6 @@ do { \ */ #else /* _CIFS_DEBUG */ #define cERROR(set, fmt, arg...) -#define cEVENT(fmt, arg...) #define cFYI(set, fmt, arg...) #define cifserror(fmt, arg...) #endif /* _CIFS_DEBUG */ -- cgit v1.2.3 From bde98197310fd085ee4bb00ab310abcbe55b0664 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 5 Dec 2012 12:42:47 -0800 Subject: 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 Reviewed-by: Jeff Layton --- fs/cifs/cifs_debug.h | 64 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 23 deletions(-) (limited to 'fs/cifs/cifs_debug.h') diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index b0fc344eb85..4d12fe48fb5 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 */ -- cgit v1.2.3 From 471b1f98719a8e8f34f3a696d488e50754f8cf73 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 5 Dec 2012 12:42:58 -0800 Subject: cifs: Add CONFIG_CIFS_DEBUG and rename use of CIFS_DEBUG This can reduce the size of the module by ~120KB which could be useful for embedded systems. $ size fs/cifs/built-in.o* text data bss dec hex filename 388567 34459 100440 523466 7fcca fs/cifs/built-in.o.new 495970 34599 117904 648473 9e519 fs/cifs/built-in.o.old Signed-off-by: Joe Perches Reviewed-by: Jeff Layton --- fs/cifs/cifs_debug.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/cifs/cifs_debug.h') diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index 4d12fe48fb5..86e92ef2abc 100644 --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#define CIFS_DEBUG /* BB temporary */ #ifndef _H_CIFS_DEBUG #define _H_CIFS_DEBUG @@ -44,7 +43,7 @@ extern int cifsERROR; * debug ON * -------- */ -#ifdef CIFS_DEBUG +#ifdef CONFIG_CIFS_DEBUG /* information message: e.g., configuration, major event */ #define cifsfyi(fmt, ...) \ -- cgit v1.2.3 From 9acbd26b0a5ac4a3d52d31034feb3d935e39032a Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 18 Dec 2012 06:35:10 -0500 Subject: cifs: eliminate cifsERROR variable It's always set to "1" and there's no way to change it to anything else. Signed-off-by: Jeff Layton Signed-off-by: Steve French --- fs/cifs/cifs_debug.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'fs/cifs/cifs_debug.h') diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index 86e92ef2abc..69ae3d3c3b3 100644 --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h @@ -37,7 +37,6 @@ void dump_smb(void *, int); #define CIFS_TIMER 0x04 extern int cifsFYI; -extern int cifsERROR; /* * debug ON @@ -64,10 +63,7 @@ do { \ /* error event message: e.g., i/o error */ #define cifserror(fmt, ...) \ -do { \ - if (cifsERROR) \ - printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ -} while (0) + printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ #define cERROR(set, fmt, ...) \ do { \ -- cgit v1.2.3