* [PATCH v2] stmmac: remove custom implementation of print_hex_dump()
@ 2014-11-07 14:53 Andy Shevchenko
2014-11-07 17:20 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2014-11-07 14:53 UTC (permalink / raw)
To: Joe Perches, Giuseppe Cavallaro, netdev, David S . Miller,
Vince Bridgers
Cc: Andy Shevchenko
There is a kernel helper to dump buffers in a hexdecimal format. This patch
substitutes the open coded function by calling that helper.
The output is slightly changed:
- no lead space
- ASCII part will be printed along with the dump
- offset is longer than 3 characters (now 8)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Since v1:
- address Joe's comments
- describe output change
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fa598b9..53db11b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -191,14 +191,8 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv)
static void print_pkt(unsigned char *buf, int len)
{
- int j;
- pr_debug("len = %d byte, buf addr: 0x%p", len, buf);
- for (j = 0; j < len; j++) {
- if ((j % 16) == 0)
- pr_debug("\n %03x:", j);
- pr_debug(" %02x", buf[j]);
- }
- pr_debug("\n");
+ pr_debug("len = %d byte, buf addr: 0x%p\n", len, buf);
+ print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);
}
/* minimum number of free TX descriptors required to wake up TX process */
--
2.1.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] stmmac: remove custom implementation of print_hex_dump()
2014-11-07 14:53 [PATCH v2] stmmac: remove custom implementation of print_hex_dump() Andy Shevchenko
@ 2014-11-07 17:20 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-11-07 17:20 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: joe, peppe.cavallaro, netdev, vbridgers2013
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Fri, 7 Nov 2014 16:53:12 +0200
> There is a kernel helper to dump buffers in a hexdecimal format. This patch
> substitutes the open coded function by calling that helper.
>
> The output is slightly changed:
> - no lead space
> - ASCII part will be printed along with the dump
> - offset is longer than 3 characters (now 8)
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> Since v1:
> - address Joe's comments
> - describe output change
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++--------
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-07 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 14:53 [PATCH v2] stmmac: remove custom implementation of print_hex_dump() Andy Shevchenko
2014-11-07 17:20 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox