From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-bluetooth@vger.kernel.org
Cc: Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: [PATCH] Bluetooth: Remove %pK formatting
Date: Fri, 18 Sep 2026 12:53:18 +0200 [thread overview]
Message-ID: <20260918105318.PdvCbvuJ@linutronix.de> (raw)
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
next reply other threads:[~2026-09-18 10:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 10:53 Sebastian Andrzej Siewior [this message]
2026-09-18 14:41 ` Bluetooth: Remove %pK formatting bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260918105318.PdvCbvuJ@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox