Skip to content

Commit 2b8cc58

Browse files
andy-shevTzung-Bi Shih
authored andcommitted
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>
1 parent f5bb4e3 commit 2b8cc58

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/platform/chrome/cros_ec_spi.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,7 @@ static void debug_packet(struct device *dev, const char *name, u8 *ptr,
104104
int len)
105105
{
106106
#ifdef DEBUG
107-
int i;
108-
109-
dev_dbg(dev, "%s: ", name);
110-
for (i = 0; i < len; i++)
111-
pr_cont(" %02x", ptr[i]);
112-
113-
pr_cont("\n");
107+
dev_dbg(dev, "%s: %*ph\n", name, len, ptr);
114108
#endif
115109
}
116110

0 commit comments

Comments
 (0)