diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-03-21 18:54:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-21 18:54:53 -0400 |
commit | 4cd9029d25f6612302f82634620f107c65f790b1 (patch) | |
tree | f98b5afba51838a8fbf47b2eecf5adceef6eb2fc /include/net | |
parent | 28518fc1701a757a3df8aa2d2ac2e5d1efd1c3e5 (diff) |
socket: SOCK_DEBUG type checking
Use the inline trick (same as pr_debug) to get checking of debug
statements even if no code is generated.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 8358fff002eb..b89680d2693b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -70,7 +70,11 @@ | |||
70 | #define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ | 70 | #define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ |
71 | printk(KERN_DEBUG msg); } while (0) | 71 | printk(KERN_DEBUG msg); } while (0) |
72 | #else | 72 | #else |
73 | #define SOCK_DEBUG(sk, msg...) do { } while (0) | 73 | /* Validate arguments and do nothing */ |
74 | static void inline int __attribute__ ((format (printf, 2, 3))) | ||
75 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | ||
76 | { | ||
77 | } | ||
74 | #endif | 78 | #endif |
75 | 79 | ||
76 | /* This is the per-socket lock. The spinlock provides a synchronization | 80 | /* This is the per-socket lock. The spinlock provides a synchronization |