Skip to content

Commit

Permalink
socket: SOCK_DEBUG type checking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 21, 2008
1 parent 28518fc commit 4cd9029
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@
#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
printk(KERN_DEBUG msg); } while (0)
#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

/* This is the per-socket lock. The spinlock provides a synchronization
Expand Down

0 comments on commit 4cd9029

Please sign in to comment.