Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938617AbcJVQwH (ORCPT ); Sat, 22 Oct 2016 12:52:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:3875 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935413AbcJVQwF (ORCPT ); Sat, 22 Oct 2016 12:52:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,531,1473145200"; d="scan'208";a="892819979" From: Andy Shevchenko To: Jens Axboe , Ming Lin , linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 1/1] skd_main: use %*ph to dump small buffers Date: Sat, 22 Oct 2016 19:52:01 +0300 Message-Id: <20161022165201.164176-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1818 Lines: 53 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 --- drivers/block/skd_main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 3822eae..6e5f941 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -2138,12 +2138,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; } @@ -2164,7 +2160,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, @@ -2177,11 +2172,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; } -- 2.9.3