static int handle_one_recv_msg(struct ipmi_smi *intf,
                               struct ipmi_smi_msg *msg);
 
-#ifdef DEBUG
-static void ipmi_debug_msg(const char *title, unsigned char *data,
-                          unsigned int len)
-{
-       int i, pos;
-       char buf[100];
-
-       pos = snprintf(buf, sizeof(buf), "%s: ", title);
-       for (i = 0; i < len; i++)
-               pos += snprintf(buf + pos, sizeof(buf) - pos,
-                               " %2.2x", data[i]);
-       pr_debug("%s\n", buf);
-}
-#else
-static void ipmi_debug_msg(const char *title, unsigned char *data,
-                          unsigned int len)
-{ }
-#endif
-
 static bool initialized;
 static bool drvregistered;
 
                ipmi_free_smi_msg(smi_msg);
                ipmi_free_recv_msg(recv_msg);
        } else {
-               ipmi_debug_msg("Send", smi_msg->data, smi_msg->data_size);
+               pr_debug("Send: %*ph\n", smi_msg->data_size, smi_msg->data);
 
                smi_send(intf, intf->handlers, smi_msg, priority);
        }
                msg->data[10] = ipmb_checksum(&msg->data[6], 4);
                msg->data_size = 11;
 
-               ipmi_debug_msg("Invalid command:", msg->data, msg->data_size);
+               pr_debug("Invalid command: %*ph\n", msg->data_size, msg->data);
 
                rcu_read_lock();
                if (!intf->in_shutdown) {
        int requeue;
        int chan;
 
-       ipmi_debug_msg("Recv:", msg->rsp, msg->rsp_size);
+       pr_debug("Recv: %*ph\n", msg->rsp_size, msg->rsp);
 
        if ((msg->data_size >= 2)
            && (msg->data[0] == (IPMI_NETFN_APP_REQUEST << 2))
        smi_msg->data_size = recv_msg->msg.data_len;
        smi_msg->msgid = STORE_SEQ_IN_MSGID(seq, seqid);
 
-       ipmi_debug_msg("Resend: ", smi_msg->data, smi_msg->data_size);
+       pr_debug("Resend: %*ph\n", smi_msg->data_size, smi_msg->data);
 
        return smi_msg;
 }