Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlcnic: Fix dump_skb output

Use normal facilities to avoid printing each byte
on a separate line.

Now emits at KERN_DEBUG instead of KERN_INFO.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
3620af0e 3f255dcc

+8 -7
+8 -7
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
··· 10 10 #include <net/ip.h> 11 11 #include <linux/ipv6.h> 12 12 #include <net/checksum.h> 13 + #include <linux/printk.h> 13 14 14 15 #include "qlcnic.h" 15 16 ··· 1466 1465 1467 1466 static void dump_skb(struct sk_buff *skb, struct qlcnic_adapter *adapter) 1468 1467 { 1469 - int i; 1470 - unsigned char *data = skb->data; 1468 + if (adapter->ahw->msg_enable & NETIF_MSG_DRV) { 1469 + char prefix[30]; 1471 1470 1472 - pr_info(KERN_INFO "\n"); 1473 - for (i = 0; i < skb->len; i++) { 1474 - QLCDB(adapter, DRV, "%02x ", data[i]); 1475 - if ((i & 0x0f) == 8) 1476 - pr_info(KERN_INFO "\n"); 1471 + scnprintf(prefix, sizeof(prefix), "%s: %s: ", 1472 + dev_name(&adapter->pdev->dev), __func__); 1473 + 1474 + print_hex_dump_debug(prefix, DUMP_PREFIX_NONE, 16, 1, 1475 + skb->data, skb->len, true); 1477 1476 } 1478 1477 } 1479 1478