aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-20 15:26:03 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:24:35 -0500
commit84116716cc9404356f775443b460f76766f08f65 (patch)
tree627662e0ac97542de873ed2071561ba2c2f0ba8e /net/dccp/ccids/ccid2.c
parentf123bc5f800d528e59684c7faffda88b4dd2d38c (diff)
[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/ccids/ccid2.c')
-rw-r--r--net/dccp/ccids/ccid2.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 6533cb2f27bb..0fb0d66544a2 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -33,18 +33,11 @@
33#include "../dccp.h" 33#include "../dccp.h"
34#include "ccid2.h" 34#include "ccid2.h"
35 35
36static int ccid2_debug;
37 36
38#ifdef CONFIG_IP_DCCP_CCID2_DEBUG 37#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
39#define ccid2_pr_debug(format, a...) \ 38static int ccid2_debug;
40 do { if (ccid2_debug) \ 39#define ccid2_pr_debug(format, a...) DCCP_PR_DEBUG(ccid2_debug, format, ##a)
41 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \
42 } while (0)
43#else
44#define ccid2_pr_debug(format, a...)
45#endif
46 40
47#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
48static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx) 41static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx)
49{ 42{
50 int len = 0; 43 int len = 0;
@@ -86,7 +79,8 @@ static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx)
86 BUG_ON(len != hctx->ccid2hctx_seqbufc * CCID2_SEQBUF_LEN); 79 BUG_ON(len != hctx->ccid2hctx_seqbufc * CCID2_SEQBUF_LEN);
87} 80}
88#else 81#else
89#define ccid2_hc_tx_check_sanity(hctx) do {} while (0) 82#define ccid2_pr_debug(format, a...)
83#define ccid2_hc_tx_check_sanity(hctx)
90#endif 84#endif
91 85
92static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num, 86static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num,
@@ -841,8 +835,10 @@ static struct ccid_operations ccid2 = {
841 .ccid_hc_rx_packet_recv = ccid2_hc_rx_packet_recv, 835 .ccid_hc_rx_packet_recv = ccid2_hc_rx_packet_recv,
842}; 836};
843 837
838#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
844module_param(ccid2_debug, int, 0444); 839module_param(ccid2_debug, int, 0444);
845MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); 840MODULE_PARM_DESC(ccid2_debug, "Enable debug messages");
841#endif
846 842
847static __init int ccid2_module_init(void) 843static __init int ccid2_module_init(void)
848{ 844{