Skip to contentSkip to conversation

platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer

PATCH Applied Andy Shevchenko 2 participants 3 messages Jun 12, 2023 – Jun 14, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/platform/chrome/cros_ec_spi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/platform/chrome/cros_ec_spi.c +1 -7
index 21143dba8970..3e88cc92e819 100644
@@ -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
 }
 
Signature · 1 line
2.40.0.1.gaa8946217a0b
#1 lore raw
This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Tue, 13 Jun 2023 00:23:36 +0300 you wrote:

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.

[...]

Here is the summary with links:
- [v1,1/1] platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer

    https://git.kernel.org/chrome-platform/c/2b8cc5858a07

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to Andy Shevchenko
This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Tue, 13 Jun 2023 00:23:36 +0300 you wrote:

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.

[...]

Here is the summary with links:
- [v1,1/1] platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer

    https://git.kernel.org/chrome-platform/c/2b8cc5858a07

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html