Re: [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework

2006-10-16 Thread David Miller
From: Per Liden <[EMAIL PROTECTED]>
Date: Fri, 13 Oct 2006 13:37:47 +0200

> From: Allan Stephens <[EMAIL PROTECTED]>
> 
> This patch allows the compiler to optimize out any code that tries to
> send debugging output to the null print buffer (TIPC_NULL), a capability
> that was unintentionally broken during the recent print buffer rework.
> 
> Signed-off-by: Allan Stephens <[EMAIL PROTECTED]>
> Signed-off-by: Per Liden <[EMAIL PROTECTED]>

Applied, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework

2006-10-13 Thread Per Liden
From: Allan Stephens <[EMAIL PROTECTED]>

This patch allows the compiler to optimize out any code that tries to
send debugging output to the null print buffer (TIPC_NULL), a capability
that was unintentionally broken during the recent print buffer rework.

Signed-off-by: Allan Stephens <[EMAIL PROTECTED]>
Signed-off-by: Per Liden <[EMAIL PROTECTED]>
---
 net/tipc/core.h |6 +++---
 net/tipc/link.c |8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/tipc/core.h b/net/tipc/core.h
index 31331e8..e3a74a3 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -83,9 +83,9 @@ #define err(fmt, arg...)  tipc_printf(TI
 #define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_WARNING "TIPC: " fmt, 
## arg)
 #define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_NOTICE "TIPC: " fmt, 
## arg)
 
-#define dbg(fmt, arg...)  do {if (DBG_OUTPUT) tipc_printf(DBG_OUTPUT, fmt, ## 
arg);} while(0)
-#define msg_dbg(msg, txt) do {if (DBG_OUTPUT) tipc_msg_print(DBG_OUTPUT, msg, 
txt);} while(0)
-#define dump(fmt, arg...) do {if (DBG_OUTPUT) tipc_dump(DBG_OUTPUT, fmt, 
##arg);} while(0)
+#define dbg(fmt, arg...)  do {if (DBG_OUTPUT != TIPC_NULL) 
tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0)
+#define msg_dbg(msg, txt) do {if (DBG_OUTPUT != TIPC_NULL) 
tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0)
+#define dump(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) 
tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0)
 
 
 /* 
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 53bc8cb..1bb983c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -132,7 +132,7 @@ static void link_print(struct link *l_pt
  * allow the output from multiple links to be intermixed.  For this reason
  * routines of the form "dbg_link_XXX()" have been created that will capture
  * debug info into a link's personal print buffer, which can then be dumped
- * into the TIPC system log (LOG) upon request.
+ * into the TIPC system log (TIPC_LOG) upon request.
  *
  * To enable per-link debugging, use LINK_LOG_BUF_SIZE to specify the size
  * of the print buffer used by each link.  If LINK_LOG_BUF_SIZE is set to 0,
@@ -141,7 +141,7 @@ static void link_print(struct link *l_pt
  * when there is only a single link in the system being debugged.
  *
  * Notes:
- * - When enabled, LINK_LOG_BUF_SIZE should be set to at least 1000 (bytes)
+ * - When enabled, LINK_LOG_BUF_SIZE should be set to at least TIPC_PB_MIN_SIZE
  * - "l_ptr" must be valid when using dbg_link_XXX() macros  
  */
 
@@ -159,13 +159,13 @@ #define dbg_link_dump() do { \
 
 static void dbg_print_link(struct link *l_ptr, const char *str)
 {
-   if (DBG_OUTPUT)
+   if (DBG_OUTPUT != TIPC_NULL)
link_print(l_ptr, DBG_OUTPUT, str);
 }
 
 static void dbg_print_buf_chain(struct sk_buff *root_buf)
 {
-   if (DBG_OUTPUT) {
+   if (DBG_OUTPUT != TIPC_NULL) {
struct sk_buff *buf = root_buf;
 
while (buf) {
-- 
1.4.1

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html