Skip to content

Commit 53c6770

Browse files
andy-shevdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 79ac522 commit 53c6770

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

drivers/net/fddi/skfp/skfddi.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,22 +1520,8 @@ void mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd)
15201520
#ifdef DUMPPACKETS
15211521
void dump_data(unsigned char *Data, int length)
15221522
{
1523-
int i, j;
1524-
unsigned char s[255], sh[10];
1525-
if (length > 64) {
1526-
length = 64;
1527-
}
15281523
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);
15391525
printk(KERN_INFO "------------------\n");
15401526
} // dump_data
15411527
#else

0 commit comments

Comments
 (0)