Commit a3df92c73b92970dc4211189b87eb4cf874f5685
Committed by
David S. Miller
1 parent
cfb0c0890b
Exists in
master
and in
7 other branches
[TIPC]: Remove code bloat introduced by print buffer rework
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 <allan.stephens@windriver.com> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 2 changed files with 7 additions and 7 deletions Side-by-side Diff
net/tipc/core.h
... | ... | @@ -83,9 +83,9 @@ |
83 | 83 | #define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_WARNING "TIPC: " fmt, ## arg) |
84 | 84 | #define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_NOTICE "TIPC: " fmt, ## arg) |
85 | 85 | |
86 | -#define dbg(fmt, arg...) do {if (DBG_OUTPUT) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0) | |
87 | -#define msg_dbg(msg, txt) do {if (DBG_OUTPUT) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0) | |
88 | -#define dump(fmt, arg...) do {if (DBG_OUTPUT) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0) | |
86 | +#define dbg(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0) | |
87 | +#define msg_dbg(msg, txt) do {if (DBG_OUTPUT != TIPC_NULL) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0) | |
88 | +#define dump(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0) | |
89 | 89 | |
90 | 90 | |
91 | 91 | /* |
net/tipc/link.c
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | * allow the output from multiple links to be intermixed. For this reason |
133 | 133 | * routines of the form "dbg_link_XXX()" have been created that will capture |
134 | 134 | * debug info into a link's personal print buffer, which can then be dumped |
135 | - * into the TIPC system log (LOG) upon request. | |
135 | + * into the TIPC system log (TIPC_LOG) upon request. | |
136 | 136 | * |
137 | 137 | * To enable per-link debugging, use LINK_LOG_BUF_SIZE to specify the size |
138 | 138 | * of the print buffer used by each link. If LINK_LOG_BUF_SIZE is set to 0, |
... | ... | @@ -141,7 +141,7 @@ |
141 | 141 | * when there is only a single link in the system being debugged. |
142 | 142 | * |
143 | 143 | * Notes: |
144 | - * - When enabled, LINK_LOG_BUF_SIZE should be set to at least 1000 (bytes) | |
144 | + * - When enabled, LINK_LOG_BUF_SIZE should be set to at least TIPC_PB_MIN_SIZE | |
145 | 145 | * - "l_ptr" must be valid when using dbg_link_XXX() macros |
146 | 146 | */ |
147 | 147 | |
148 | 148 | |
... | ... | @@ -159,13 +159,13 @@ |
159 | 159 | |
160 | 160 | static void dbg_print_link(struct link *l_ptr, const char *str) |
161 | 161 | { |
162 | - if (DBG_OUTPUT) | |
162 | + if (DBG_OUTPUT != TIPC_NULL) | |
163 | 163 | link_print(l_ptr, DBG_OUTPUT, str); |
164 | 164 | } |
165 | 165 | |
166 | 166 | static void dbg_print_buf_chain(struct sk_buff *root_buf) |
167 | 167 | { |
168 | - if (DBG_OUTPUT) { | |
168 | + if (DBG_OUTPUT != TIPC_NULL) { | |
169 | 169 | struct sk_buff *buf = root_buf; |
170 | 170 | |
171 | 171 | while (buf) { |