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

net: fddi: skfp: Use print_hex_dump() helper

Use the print_hex_dump() helper, instead of open-coding the same operations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Shevchenko and committed by
David S. Miller
53c67700 79ac5224

+1 -15
+1 -15
drivers/net/fddi/skfp/skfddi.c
··· 1520 1520 #ifdef DUMPPACKETS 1521 1521 void dump_data(unsigned char *Data, int length) 1522 1522 { 1523 - int i, j; 1524 - unsigned char s[255], sh[10]; 1525 - if (length > 64) { 1526 - length = 64; 1527 - } 1528 1523 printk(KERN_INFO "---Packet start---\n"); 1529 - for (i = 0, j = 0; i < length / 8; i++, j += 8) 1530 - printk(KERN_INFO "%02x %02x %02x %02x %02x %02x %02x %02x\n", 1531 - Data[j + 0], Data[j + 1], Data[j + 2], Data[j + 3], 1532 - Data[j + 4], Data[j + 5], Data[j + 6], Data[j + 7]); 1533 - strcpy(s, ""); 1534 - for (i = 0; i < length % 8; i++) { 1535 - sprintf(sh, "%02x ", Data[j + i]); 1536 - strcat(s, sh); 1537 - } 1538 - printk(KERN_INFO "%s\n", s); 1524 + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, Data, min_t(size_t, length, 64), false); 1539 1525 printk(KERN_INFO "------------------\n"); 1540 1526 } // dump_data 1541 1527 #else