summaryrefslogtreecommitdiff
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-20 23:26:03 +0300
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 08:24:35 +0300
commit84116716cc9404356f775443b460f76766f08f65 (patch)
tree627662e0ac97542de873ed2071561ba2c2f0ba8e /net/dccp/dccp.h
parentf123bc5f800d528e59684c7faffda88b4dd2d38c (diff)
downloadlinux-84116716cc9404356f775443b460f76766f08f65.tar.xz
[DCCP]: enable debug messages also for static builds
This patch * makes debugging (when configured) work both for static / module build * provides generic debugging macros for use in other DCCP / CCID modules * adds missing information about debug parameters to Kconfig * performs some code tidy-up Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index ecb4e7bd1a84..33d86f53138b 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -26,15 +26,20 @@
__stringify((cond))); \
} while (0)
+#ifdef MODULE
+#define DCCP_PRINTK(enable, fmt, args...) do { if (enable) \
+ printk(fmt, ##args); \
+ } while(0)
+#else
+#define DCCP_PRINTK(enable, fmt, args...) printk(fmt, ##args)
+#endif
+#define DCCP_PR_DEBUG(enable, fmt, a...) DCCP_PRINTK(enable, KERN_DEBUG \
+ "%s: " fmt, __FUNCTION__, ##a)
+
#ifdef CONFIG_IP_DCCP_DEBUG
extern int dccp_debug;
-
-#define dccp_pr_debug(format, a...) \
- do { if (dccp_debug) \
- printk(KERN_DEBUG "%s: " format, __FUNCTION__ , ##a); \
- } while (0)
-#define dccp_pr_debug_cat(format, a...) do { if (dccp_debug) \
- printk(format, ##a); } while (0)
+#define dccp_pr_debug(format, a...) DCCP_PR_DEBUG(dccp_debug, format, ##a)
+#define dccp_pr_debug_cat(format, a...) DCCP_PRINTK(dccp_debug, format, ##a)
#else
#define dccp_pr_debug(format, a...)
#define dccp_pr_debug_cat(format, a...)