Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Remove %pK formatting
@ 2026-09-18 10:53 Sebastian Andrzej Siewior
  2026-09-18 14:41 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-09-18 10:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Marcel Holtmann, Luiz Augusto von Dentz

Commit 71338aa7d050c ("net: convert %p usage to %pK") which is from
2011 and changed the %p annotation for pointer to %pK. Back then the
default behaviour for %p was to print the pointer. The %pK modifier was
introduced to able to control the behaviour of specific pointer values
without changing the behaviour of %p for everyone. It was dedicated to
avoid leaking pointers via /proc.
With the introduction of bt_procfs_init(), bluetooth followed this %pK
semantic.

Things changed over time. Since printing the pointer did not add any
value, networking prints now 0 instead of the socket pointer.

Replace %pK with 0 value, update the header line to match column names.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

The relevant net commit is 7c0ec6288b497 ("net: Replace %pK output with
0") which is net-next.

 net/bluetooth/af_bluetooth.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 411d66f24393d..8dc06fc1811ec 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -846,7 +846,7 @@ static int bt_seq_show(struct seq_file *seq, void *v)
 	struct bt_sock_list *l = pde_data(file_inode(seq->file));
 
 	if (v == SEQ_START_TOKEN) {
-		seq_puts(seq, "sk               RefCnt Rmem   Wmem   User   Inode  Parent");
+		seq_puts(seq, "sk  RefCnt Rmem   Wmem   User   Inode  Parent");
 
 		if (l->custom_seq_show) {
 			seq_putc(seq, ' ');
@@ -859,8 +859,7 @@ static int bt_seq_show(struct seq_file *seq, void *v)
 		struct bt_sock *bt = bt_sk(sk);
 
 		seq_printf(seq,
-			   "%pK %-6d %-6u %-6u %-6u %-6llu %-6llu",
-			   sk,
+			   " 0  %-6d %-6u %-6u %-6u %-6llu %-6llu",
 			   refcount_read(&sk->sk_refcnt),
 			   sk_rmem_alloc_get(sk),
 			   sk_wmem_alloc_get(sk),
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-18 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-18 10:53 [PATCH] Bluetooth: Remove %pK formatting Sebastian Andrzej Siewior
2026-09-18 14:41 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox