Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: bigeasy@linutronix.de
Cc: socketcan@hartkopp.net, linux-atm-general@lists.sourceforge.net,
	linux-can@vger.kernel.org, linux-sctp@vger.kernel.org,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	herbert@gondor.apana.org.au, kuba@kernel.org, kuniyu@google.com,
	mkl@pengutronix.de, marcelo.leitner@gmail.com,
	ncardwell@google.com, pabeni@redhat.com, courmisch@gmail.com,
	horms@kernel.org, steffen.klassert@secunet.com,
	willemdebruijn.kernel@gmail.com, lucien.xin@gmail.com,
	pmladek@suse.com, thomas.weissschuh@linutronix.de,
	kees@kernel.org
Subject: Re: [net-next,real,v4] net: Replace %pK output with 0
Date: Wed, 02 Sep 2026 22:10:24 +0000	[thread overview]
Message-ID: <178838702467.3394541.6607347117257503033@kernel.org> (raw)
In-Reply-To: <20260901160345.eeknHmY2@linutronix.de>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 1 · Low: 1

- [Medium] Incomplete conversion relative to the commit's stated scope:
  after this patch net/ still contains %pK socket/object-pointer output.
- [Low] The updated /proc/net/tcp example in
  Documentation/networking/proc_net_tcp.rst does not match the…

--

net: Replace %pK output with 0

This replaces the %pK pointer output in the various /proc/net seq_file
printers with a literal 0, adjusting field spacing and header strings so
the column layout stays intact. Documentation/networking/proc_net_tcp.rst
is updated to describe the field as always 0.

> net: Replace %pK output with 0
[ ... ]
>     Replace the %pK annotation with 0 value. Correct the spacing for the
>     cases where pointer is at the beginning.

[Severity: Medium]
The subject and this sentence read as if net/ no longer emits pointers,
but three files under net/ still use %pK after this commit:

  net/bluetooth/af_bluetooth.c:bt_seq_show()
	seq_printf(seq,
		   "%pK %-6d %-6u %-6u %-6u %-6llu %-6llu",
		   sk,

  net/can/proc.c:can_print_rcvlist()
	char *fmt = (r->can_id & CAN_EFF_FLAG)?
		"   %-5s  %08x  %08x  %pK  %pK  %8ld  %s\n" :
		"   %-5s     %03x    %08x  %pK  %pK  %8ld  %s\n";

  net/can/bcm.c:bcm_proc_show()
	seq_printf(m, ">>> socket %pK", sk->sk_socket);
	seq_printf(m, " / sk %pK", sk);
	seq_printf(m, " / bo %pK", bo);

bt_seq_show() is installed by bt_procfs_init() for every Bluetooth
protocol, so /proc/net/l2cap, /proc/net/sco, /proc/net/rfcomm*,
/proc/net/hci*, /proc/net/iso, /proc/net/bnep and /proc/net/hidp keep
printing the struct sock pointer.

The changelog below the '---' line says the CAN changes were dropped on
purpose, but that text is discarded when the patch is applied, and the
Bluetooth site is not mentioned at all. Could the commit message name the
remaining sites so git log does not suggest net/ was fully converted?

> diff --git a/Documentation/networking/proc_net_tcp.rst b/Documentation/networking/proc_net_tcp.rst
> index 7d9dfe36af45b..4fa2e58429b95 100644
> --- a/Documentation/networking/proc_net_tcp.rst
> +++ b/Documentation/networking/proc_net_tcp.rst
> @@ -30,16 +30,16 @@ up into 3 parts because of the length of the line)::
>        |        |----------------------> receive-queue
>        |-------------------------------> transmit-queue
>  
> -   1000        0 54165785 4 cd1e6040 25 4 27 3 -1
> -    |          |    |     |    |     |  | |  | |--> slow start size threshold,
> -    |          |    |     |    |     |  | |  |      or -1 if the threshold
> -    |          |    |     |    |     |  | |  |      is >= 0xFFFF
> -    |          |    |     |    |     |  | |  |----> sending congestion window
> -    |          |    |     |    |     |  | |-------> (ack.quick<<1)|ack.pingpong
> -    |          |    |     |    |     |  |---------> Predicted tick of soft clock
> -    |          |    |     |    |     |              (delayed ACK control data)
> -    |          |    |     |    |     |------------> retransmit timeout
> -    |          |    |     |    |------------------> location of socket in memory
> +   1000        0 54165785 4  0  25 4 27 3 -1

[Severity: Low]
Does the example still match what the kernel prints? The example shows two
spaces on each side of the new always-zero field, while get_tcp4_sock() in
net/ipv4/tcp_ipv4.c and get_tcp6_sock() in net/ipv6/tcp_ipv6.c both emit a
single space on each side:

	"%08X %5u %8d %llu %d 0 %lu %lu %u %u %d"

so the real line is:

   1000        0 54165785 4 0 25 4 27 3 -1

Should the example (and the arrow alignment below it) use the single-space
spacing, or should the format strings pad the field if the wider column is
intended?

> +    |          |    |     |  |  |  | |  | |-------> slow start size threshold,
> +    |          |    |     |  |  |  | |  |           or -1 if the threshold
> +    |          |    |     |  |  |  | |  |           is >= 0xFFFF
> +    |          |    |     |  |  |  | |  |---------> sending congestion window
> +    |          |    |     |  |  |  | |------------> (ack.quick<<1)|ack.pingpong
> +    |          |    |     |  |  |  |--------------> Predicted tick of soft clock
> +    |          |    |     |  |  |                   (delayed ACK control data)
> +    |          |    |     |  |  |-----------------> retransmit timeout
> +    |          |    |     |  |--------------------> always 0 (was memory location).
>      |          |    |     |-----------------------> socket reference count
>      |          |    |-----------------------------> inode
>      |          |----------------------------------> unanswered 0-window probes

[ ... ]

> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 9f053eb8b46e2..142e7b048229e 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -2811,7 +2810,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i)
>  				      READ_ONCE(tp->copied_seq), 0);
>  
>  	seq_printf(f, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
> -			"%08X %5u %8d %llu %d %pK %lu %lu %u %u %d",
> +			"%08X %5u %8d %llu %d 0 %lu %lu %u %u %d",
>  		i, src, srcp, dest, destp, state,
>  		READ_ONCE(tp->write_seq) - tp->snd_una,
>  		rx_queue,

[ ... ]

> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index df9c29eb5c1f4..b55d036c7f4da 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -2171,7 +2171,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
>  
>  	seq_printf(seq,
>  		   "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
> -		   "%02X %08X:%08X %02X:%08lX %08X %5u %8d %llu %d %pK %lu %lu %u %u %d\n",
> +		   "%02X %08X:%08X %02X:%08lX %08X %5u %8d %llu %d 0 %lu %lu %u %u %d\n",
>  		   i,
>  		   src->s6_addr32[0], src->s6_addr32[1],
>  		   src->s6_addr32[2], src->s6_addr32[3], srcp,

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260901160345.eeknHmY2%40linutronix.de

  reply	other threads:[~2026-09-02 22:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 15:37 [PATCH net-next v4] net: Replace %pK output with 0 Sebastian Andrzej Siewior
2026-09-01 15:51 ` Oliver Hartkopp
2026-09-01 16:01   ` Sebastian Andrzej Siewior
2026-09-01 16:03     ` [PATCH net-next real " Sebastian Andrzej Siewior
2026-09-02 22:10       ` netdev-bot+sashiko [this message]
2026-09-03  2:00       ` patchwork-bot+netdevbpf

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=178838702467.3394541.6607347117257503033@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=courmisch@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=mkl@pengutronix.de \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmladek@suse.com \
    --cc=socketcan@hartkopp.net \
    --cc=steffen.klassert@secunet.com \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=willemdebruijn.kernel@gmail.com \
    /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