Skip to content

Commit

Permalink
Staging: usbip: use print_hex_dump() instead of open coding it.
Browse files Browse the repository at this point in the history
Signed-off-by: Himanshu Chauhan <himanshu@symmetricore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Himanshu Chauhan authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 1e5065d commit aad8657
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions drivers/staging/usbip/usbip_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,8 @@ DEVICE_ATTR(usbip_debug, (S_IRUGO | S_IWUSR), show_flag, store_flag);

static void usbip_dump_buffer(char *buff, int bufflen)
{
int i;

if (bufflen > 128) {
for (i = 0; i < 128; i++) {
if (i%24 == 0)
printk(KERN_DEBUG " ");
printk(KERN_DEBUG "%02x ", (unsigned char) buff[i]);
if (i%4 == 3)
printk(KERN_DEBUG "| ");
if (i%24 == 23)
printk(KERN_DEBUG "\n");
}
printk(KERN_DEBUG "... (%d byte)\n", bufflen);
return;
}

for (i = 0; i < bufflen; i++) {
if (i%24 == 0)
printk(KERN_DEBUG " ");
printk(KERN_DEBUG "%02x ", (unsigned char) buff[i]);
if (i%4 == 3)
printk(KERN_DEBUG "| ");
if (i%24 == 23)
printk(KERN_DEBUG "\n");
}
printk(KERN_DEBUG "\n");

print_hex_dump(KERN_DEBUG, "usb-ip", DUMP_PREFIX_OFFSET, 16, 4,
buff, bufflen, false);
}

static void usbip_dump_pipe(unsigned int p)
Expand Down

0 comments on commit aad8657

Please sign in to comment.