skd_main: use %*ph to dump small buffers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 22 Oct 2016 16:52:01 +0000 (19:52 +0300)
committerJens Axboe <axboe@fb.com>
Tue, 8 Nov 2016 04:40:42 +0000 (21:40 -0700)
Replace custom approach by %*ph specifier to dump small buffers in hex format.

Unfortunately we can't use print_hex_dump_bytes() here since tha gap is
present, though one familiar with the code may change this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/skd_main.c

index 702f543a4a64ad08413f8cb4d48e92100b1a4c34..a58256cd94d73db0c1c00d3c57fba4a013c47321 100644 (file)
@@ -2136,12 +2136,8 @@ static void skd_send_fitmsg(struct skd_device *skdev,
                u8 *bp = (u8 *)skmsg->msg_buf;
                int i;
                for (i = 0; i < skmsg->length; i += 8) {
-                       pr_debug("%s:%s:%d msg[%2d] %02x %02x %02x %02x "
-                                "%02x %02x %02x %02x\n",
-                                skdev->name, __func__, __LINE__,
-                                i, bp[i + 0], bp[i + 1], bp[i + 2],
-                                bp[i + 3], bp[i + 4], bp[i + 5],
-                                bp[i + 6], bp[i + 7]);
+                       pr_debug("%s:%s:%d msg[%2d] %8ph\n",
+                                skdev->name, __func__, __LINE__, i, &bp[i]);
                        if (i == 0)
                                i = 64 - 8;
                }
@@ -2162,7 +2158,6 @@ static void skd_send_fitmsg(struct skd_device *skdev,
                qcmd |= FIT_QCMD_MSGSIZE_64;
 
        SKD_WRITEQ(skdev, qcmd, FIT_Q_COMMAND);
-
 }
 
 static void skd_send_special_fitmsg(struct skd_device *skdev,
@@ -2175,11 +2170,8 @@ static void skd_send_special_fitmsg(struct skd_device *skdev,
                int i;
 
                for (i = 0; i < SKD_N_SPECIAL_FITMSG_BYTES; i += 8) {
-                       pr_debug("%s:%s:%d  spcl[%2d] %02x %02x %02x %02x  "
-                                "%02x %02x %02x %02x\n",
-                                skdev->name, __func__, __LINE__, i,
-                                bp[i + 0], bp[i + 1], bp[i + 2], bp[i + 3],
-                                bp[i + 4], bp[i + 5], bp[i + 6], bp[i + 7]);
+                       pr_debug("%s:%s:%d  spcl[%2d] %8ph\n",
+                                skdev->name, __func__, __LINE__, i, &bp[i]);
                        if (i == 0)
                                i = 64 - 8;
                }