tipc: simplify link_print by divorcing it from using tipc_printf
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 11 Jul 2012 23:27:56 +0000 (19:27 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 13 Jul 2012 23:27:57 +0000 (19:27 -0400)
To pave the way for a pending cleanup of tipc_printf, and
removal of struct print_buf entirely, we make that task simpler
by converting link_print to issue its messages with standard
printk infrastructure.  [Original idea separated from a larger
patch from Erik Hugne <erik.hugne@ericsson.com>]

Cc: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/link.c

index 9ba70c9711426b4e94718803bd53cb43eae2cc38..a9a8b866d30ad33d609fd561b23f3892c04a6085 100644 (file)
@@ -3009,26 +3009,16 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector)
 
 static void link_print(struct tipc_link *l_ptr, const char *str)
 {
-       char print_area[256];
-       struct print_buf pb;
-       struct print_buf *buf = &pb;
-
-       tipc_printbuf_init(buf, print_area, sizeof(print_area));
-
-       tipc_printf(buf, str);
-       tipc_printf(buf, "Link %x<%s>:",
-                   l_ptr->addr, l_ptr->b_ptr->name);
+       pr_info("%s Link %x<%s>:", str, l_ptr->addr, l_ptr->b_ptr->name);
 
        if (link_working_unknown(l_ptr))
-               tipc_printf(buf, ":WU");
+               pr_cont(":WU\n");
        else if (link_reset_reset(l_ptr))
-               tipc_printf(buf, ":RR");
+               pr_cont(":RR\n");
        else if (link_reset_unknown(l_ptr))
-               tipc_printf(buf, ":RU");
+               pr_cont(":RU\n");
        else if (link_working_working(l_ptr))
-               tipc_printf(buf, ":WW");
-       tipc_printf(buf, "\n");
-
-       tipc_printbuf_validate(buf);
-       pr_info("%s", print_area);
+               pr_cont(":WW\n");
+       else
+               pr_cont("\n");
 }