Skip to contentSkip to conversation

rtw88: use %*ph to print small buffer

PATCH In review Andy Shevchenko 3 participants 3 messages Jun 3, 2022 – Jun 8, 2022

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

PATCH 1/1 rtw88: use %*ph to print small buffer

Use %*ph format to print small buffer as hex string.

---
 drivers/net/wireless/realtek/rtw88/debug.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/realtek/rtw88/debug.c +1 -5
index 1a52ff585fbc..7cde6bcf253b 100644
@@ -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);
 
Signature · 1 line
2.35.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Friday, June 3, 2022 8:57 PM
To: Ping-Ke Shih <[email protected]>; Kalle Valo <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: Yan-Hsuan Chuang <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Andy Shevchenko <[email protected]>
Subject: [PATCH v1 1/1] rtw88: use %*ph to print small buffer

Quoted 3 lines

Use %*ph format to print small buffer as hex string.

Thanks!

Quoted 23 lines
---
 drivers/net/wireless/realtek/rtw88/debug.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/realtek/rtw88/debug.c +1 -6
index 1a52ff585fbc..7cde6bcf253b 100644
@@ -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

#2 lore raw

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

In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

Use %*ph format to print small buffer as hex string.

Patch applied to wireless-next.git, thanks.

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

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches