extern struct print_buf *const TIPC_LOG;
 
 void tipc_printf(struct print_buf *, const char *fmt, ...);
-void tipc_msg_print(struct print_buf *, struct tipc_msg *, const char *);
-void tipc_dump(struct print_buf *, const char *fmt, ...);
 
 /*
  * TIPC_OUTPUT is the destination print buffer for system messages.
 #define msg_dbg(msg, txt) \
        do { \
                if (DBG_OUTPUT != TIPC_NULL) \
-                       tipc_msg_print(DBG_OUTPUT, msg, txt); \
+                       tipc_msg_dbg(DBG_OUTPUT, msg, txt); \
        } while (0)
 #define dump(fmt, arg...) \
        do { \
                if (DBG_OUTPUT != TIPC_NULL) \
-                       tipc_dump(DBG_OUTPUT, fmt, ##arg); \
+                       tipc_dump_dbg(DBG_OUTPUT, fmt, ##arg); \
        } while (0)
 
+void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *);
+void tipc_dump_dbg(struct print_buf *, const char *fmt, ...);
+
 #else
 
 #define dbg(fmt, arg...)       do {} while (0)
 #define msg_dbg(msg, txt)      do {} while (0)
 #define dump(fmt, arg...)      do {} while (0)
 
+#define tipc_msg_dbg(...)      do {} while (0)
+#define tipc_dump_dbg(...)     do {} while (0)
+
 #endif
 
 
 
        spin_unlock_bh(&print_lock);
 }
 
+#ifdef CONFIG_TIPC_DEBUG
+
 /**
  * print_to_console - write string of bytes to console in multiple chunks
  */
 }
 
 /**
- * tipc_dump - dump (non-console) print buffer to console
+ * tipc_dump_dbg - dump (non-console) print buffer to console
  * @pb: pointer to print buffer
  */
 
-void tipc_dump(struct print_buf *pb, const char *fmt, ...)
+void tipc_dump_dbg(struct print_buf *pb, const char *fmt, ...)
 {
        int len;
 
        spin_unlock_bh(&print_lock);
 }
 
+#endif
+
 /**
  * tipc_log_resize - change the size of the TIPC log buffer
  * @log_size: print buffer size to use
 
 
 #define LINK_LOG_BUF_SIZE 0
 
-#define dbg_link(fmt, arg...)  do {if (LINK_LOG_BUF_SIZE) tipc_printf(&l_ptr->print_buf, fmt, ## arg); } while(0)
-#define dbg_link_msg(msg, txt) do {if (LINK_LOG_BUF_SIZE) tipc_msg_print(&l_ptr->print_buf, msg, txt); } while(0)
-#define dbg_link_state(txt) do {if (LINK_LOG_BUF_SIZE) link_print(l_ptr, &l_ptr->print_buf, txt); } while(0)
+#define dbg_link(fmt, arg...) \
+       do { \
+               if (LINK_LOG_BUF_SIZE) \
+                       tipc_printf(&l_ptr->print_buf, fmt, ## arg); \
+       } while (0)
+#define dbg_link_msg(msg, txt) \
+       do { \
+               if (LINK_LOG_BUF_SIZE) \
+                       tipc_msg_dbg(&l_ptr->print_buf, msg, txt); \
+       } while (0)
+#define dbg_link_state(txt) \
+       do { \
+               if (LINK_LOG_BUF_SIZE) \
+                       link_print(l_ptr, &l_ptr->print_buf, txt); \
+       } while (0)
 #define dbg_link_dump() do { \
        if (LINK_LOG_BUF_SIZE) { \
                tipc_printf(LOG, "\n\nDumping link <%s>:\n", l_ptr->name); \
        struct tipc_msg *msg = buf_msg(buf);
 
        warn("Retransmission failure on link <%s>\n", l_ptr->name);
-       tipc_msg_print(TIPC_OUTPUT, msg, ">RETR-FAIL>");
+       tipc_msg_dbg(TIPC_OUTPUT, msg, ">RETR-FAIL>");
 
        if (l_ptr->addr) {
 
 
 #include "bearer.h"
 
 
-void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str)
+#ifdef CONFIG_TIPC_DEBUG
+
+void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
 {
        u32 usr = msg_user(msg);
        tipc_printf(buf, str);
        }
        tipc_printf(buf, "\n");
        if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg))) {
-               tipc_msg_print(buf,msg_get_wrapped(msg),"      /");
+               tipc_msg_dbg(buf, msg_get_wrapped(msg), "      /");
        }
        if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT)) {
-               tipc_msg_print(buf,msg_get_wrapped(msg),"      /");
+               tipc_msg_dbg(buf, msg_get_wrapped(msg), "      /");
        }
 }
+
+#endif