summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/cros_ec_spi.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-06-13 00:23:36 +0300
committerTzung-Bi Shih <tzungbi@kernel.org>2023-06-13 12:28:36 +0800
commit2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9 (patch)
tree98ce180c691544fcf638797a5e231a9134e90f3f /drivers/platform/chrome/cros_ec_spi.c
parentf5bb4e381290883a014a9e865ee2c430447ef953 (diff)
downloadlinux-stable-2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9.tar.gz
linux-stable-2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9.tar.bz2
linux-stable-2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9.zip
platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer
The kernel already has a helper to print a hexdump of a small buffer via pointer extension. Use that instead of open coded variant. In long term it helps to kill pr_cont() or at least narrow down its use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230612212336.4961-1-andriy.shevchenko@linux.intel.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_spi.c')
-rw-r--r--drivers/platform/chrome/cros_ec_spi.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 21143dba8970..3e88cc92e819 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -104,13 +104,7 @@ static void debug_packet(struct device *dev, const char *name, u8 *ptr,
int len)
{
#ifdef DEBUG
- int i;
-
- dev_dbg(dev, "%s: ", name);
- for (i = 0; i < len; i++)
- pr_cont(" %02x", ptr[i]);
-
- pr_cont("\n");
+ dev_dbg(dev, "%s: %*ph\n", name, len, ptr);
#endif
}