From: Andy Shevchenko Date: Mon, 12 Jun 2023 21:23:36 +0000 (+0300) Subject: platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer X-Git-Tag: v6.5-rc1~210^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b8cc5858a07ab75ce98cae720e263e1c1b0d1d9;p=thirdparty%2Flinux.git 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 Link: https://lore.kernel.org/r/20230612212336.4961-1-andriy.shevchenko@linux.intel.com Signed-off-by: Tzung-Bi Shih --- diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c index 21143dba89704..3e88cc92e8192 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 }