diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-09-05 17:56:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-23 22:15:18 -0700 |
commit | 7adce46784a0992eb7276416798db6746ba8f667 (patch) | |
tree | fc93babd9412ad7f29e94aa79f019ac1a869215a /drivers/usb | |
parent | 13d79f223ff369970f3c9b402035125dd3c9cc00 (diff) | |
download | op-kernel-dev-7adce46784a0992eb7276416798db6746ba8f667.zip op-kernel-dev-7adce46784a0992eb7276416798db6746ba8f667.tar.gz |
USB: storage: use %*ph specifier to dump small buffers
Instead of dereference each byte let's use %*ph specifier in the printk()
calls.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/storage/alauda.c | 11 | ||||
-rw-r--r-- | drivers/usb/storage/sddr09.c | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 6636a58..62c2d9d 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c @@ -415,14 +415,11 @@ static int alauda_init_media(struct us_data *us) if (alauda_get_media_signature(us, data) != USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; - usb_stor_dbg(us, "Media signature: %02X %02X %02X %02X\n", - data[0], data[1], data[2], data[3]); + usb_stor_dbg(us, "Media signature: %4ph\n", data); media_info = alauda_card_find_id(data[1]); if (media_info == NULL) { - printk(KERN_WARNING - "alauda_init_media: Unrecognised media signature: " - "%02X %02X %02X %02X\n", - data[0], data[1], data[2], data[3]); + pr_warn("alauda_init_media: Unrecognised media signature: %4ph\n", + data); return USB_STOR_TRANSPORT_ERROR; } @@ -513,7 +510,7 @@ static int alauda_check_status2(struct us_data *us) if (rc != USB_STOR_XFER_GOOD) return rc; - usb_stor_dbg(us, "%02X %02X %02X\n", data[0], data[1], data[2]); + usb_stor_dbg(us, "%3ph\n", data); if (data[0] & ALAUDA_STATUS_ERROR) return USB_STOR_XFER_ERROR; diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c index 38a4504..3847053 100644 --- a/drivers/usb/storage/sddr09.c +++ b/drivers/usb/storage/sddr09.c @@ -1155,8 +1155,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) { return NULL; } - sprintf(blurbtxt, "sddr09: Found Flash card, ID = %02X %02X %02X %02X", - deviceID[0], deviceID[1], deviceID[2], deviceID[3]); + sprintf(blurbtxt, "sddr09: Found Flash card, ID = %4ph", deviceID); /* Byte 0 is the manufacturer */ sprintf(blurbtxt + strlen(blurbtxt), |