RE: [PATCH v1 1/1] rtw88: use %*ph to print small buffer

From: Ping-Ke Shih
Date: Mon Jun 06 2022 - 02:46:31 EST



> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Sent: Friday, June 3, 2022 8:57 PM
> To: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; Kalle Valo <kvalo@xxxxxxxxxx>; linux-wireless@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: Yan-Hsuan Chuang <tony0620emma@xxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Subject: [PATCH v1 1/1] rtw88: use %*ph to print small buffer
>
> Use %*ph format to print small buffer as hex string.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Thanks!

Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>

> ---
> drivers/net/wireless/realtek/rtw88/debug.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
> index 1a52ff585fbc..7cde6bcf253b 100644
> --- a/drivers/net/wireless/realtek/rtw88/debug.c
> +++ b/drivers/net/wireless/realtek/rtw88/debug.c
> @@ -269,11 +269,7 @@ static int rtw_debugfs_get_rsvd_page(struct seq_file *m, void *v)
> for (i = 0 ; i < buf_size ; i += 8) {
> if (i % page_size == 0)
> seq_printf(m, "PAGE %d\n", (i + offset) / page_size);
> - seq_printf(m, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
> - *(buf + i), *(buf + i + 1),
> - *(buf + i + 2), *(buf + i + 3),
> - *(buf + i + 4), *(buf + i + 5),
> - *(buf + i + 6), *(buf + i + 7));
> + seq_printf(m, "%8ph\n", buf + i);
> }
> vfree(buf);
>
> --
> 2.35.1