From: Stephen Hemminger Date: Fri, 21 Mar 2008 22:54:53 +0000 (-0700) Subject: socket: SOCK_DEBUG type checking X-Git-Tag: v2.6.26-rc1~1138^2~403 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd9029d25f6612302f82634620f107c65f790b1;p=linux-2.6 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 Signed-off-by: David S. Miller --- diff --git a/include/net/sock.h b/include/net/sock.h index 8358fff002..b89680d269 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -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