From: Himanshu Chauhan Date: Fri, 22 Jan 2010 21:22:41 +0000 (+0530) Subject: Staging: usbip: use print_hex_dump() instead of open coding it. X-Git-Tag: v2.6.34-rc1~10^2~1^2~132 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=aad86577b829be29048e0a692e1c28c3ffeda6ca;p=~shefty%2Frdma-dev.git Staging: usbip: use print_hex_dump() instead of open coding it. Signed-off-by: Himanshu Chauhan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c index 57c0ff5ab9a..3367a521769 100644 --- a/drivers/staging/usbip/usbip_common.c +++ b/drivers/staging/usbip/usbip_common.c @@ -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)