[v2,1/2] mfd: ipaq-micro: Use %*ph for printing hexdump of a small buffer

Message ID 20230703140923.2840-1-andriy.shevchenko@linux.intel.com
State New
Headers
Series [v2,1/2] mfd: ipaq-micro: Use %*ph for printing hexdump of a small buffer |

Commit Message

Andy Shevchenko July 3, 2023, 2:09 p.m. UTC
  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>
---
v2: split another change to a separate patch (Lee)
 drivers/mfd/ipaq-micro.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Lee Jones July 13, 2023, 10:20 a.m. UTC | #1
On Mon, 03 Jul 2023, Andy Shevchenko 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: split another change to a separate patch (Lee)
>  drivers/mfd/ipaq-micro.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied, thanks
  

Patch

diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index 6d3968458e81..cddfd2e808f2 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -131,10 +131,7 @@  static void micro_rx_msg(struct ipaq_micro *micro, u8 id, int len, u8 *data)
 		break;
 	default:
 		dev_err(micro->dev,
-			"unknown msg %d [%d] ", id, len);
-		for (i = 0; i < len; ++i)
-			pr_cont("0x%02x ", data[i]);
-		pr_cont("\n");
+			"unknown msg %d [%d] %*ph\n", id, len, len, data);
 	}
 	spin_unlock(&micro->lock);
 }