diff mbox series

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

Message ID 20220603125648.46873-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [v1,1/1] rtw88: use %*ph to print small buffer | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andy Shevchenko June 3, 2022, 12:56 p.m. UTC
Use %*ph format to print small buffer as hex string.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/wireless/realtek/rtw88/debug.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Ping-Ke Shih June 6, 2022, 6:45 a.m. UTC | #1
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Friday, June 3, 2022 8:57 PM
> To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Yan-Hsuan Chuang <tony0620emma@gmail.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>
> 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@linux.intel.com>

Thanks!

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  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
Kalle Valo June 8, 2022, 8:07 a.m. UTC | #2
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use %*ph format to print small buffer as hex string.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

d38c9df53ad6 wifi: rtw88: use %*ph to print small buffer
diff mbox series

Patch

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);