提交 4cd9029d 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

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: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 28518fc1
...@@ -70,7 +70,11 @@ ...@@ -70,7 +70,11 @@
#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ #define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
printk(KERN_DEBUG msg); } while (0) printk(KERN_DEBUG msg); } while (0)
#else #else
#define SOCK_DEBUG(sk, msg...) do { } while (0) /* Validate arguments and do nothing */
static void inline int __attribute__ ((format (printf, 2, 3)))
SOCK_DEBUG(struct sock *sk, const char *msg, ...)
{
}
#endif #endif
/* This is the per-socket lock. The spinlock provides a synchronization /* This is the per-socket lock. The spinlock provides a synchronization
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册