Netdev List
 help / color / mirror / Atom feed
* [PATCH] net/rxrpc: Simplify rxrpcpeerseq_next()
@ 2026-10-15 20:01 Chelsy Ratnawat
  2026-10-16  5:59 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Chelsy Ratnawat @ 2026-10-15 20:01 UTC (permalink / raw)
  To: dhowells, davem, marc.dionne; +Cc: netdev, Chelsy Ratnawat

Remove the redundant initialization and conditional handling of n,
as it is always set to 1. Use the constant directly when updating
*_pos and starting the hlist iteration.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
---
 net/rxrpc/proc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c
index e9a27fa7b25d..608670dc97d9 100644
--- a/net/rxrpc/proc.c
+++ b/net/rxrpc/proc.c
@@ -367,19 +367,14 @@ static void *rxrpc_peer_seq_next(struct seq_file *seq, void *v, loff_t *_pos)
 
 	for (;;) {
 		bucket++;
-		n = 1;
-		*_pos = (bucket << shift) | n;
+		*_pos = (bucket << shift) | 1;
 
 		if (bucket >= HASH_SIZE(rxnet->peer_hash)) {
 			*_pos = UINT_MAX;
 			return NULL;
 		}
-		if (n == 0) {
-			*_pos += 1;
-			n++;
-		}
 
-		p = seq_hlist_start_rcu(&rxnet->peer_hash[bucket], n - 1);
+		p = seq_hlist_start_rcu(&rxnet->peer_hash[bucket], 0);
 		if (p)
 			return p;
 	}
-- 
2.53.0


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

end of thread, other threads:[~2026-10-16  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 20:01 [PATCH] net/rxrpc: Simplify rxrpcpeerseq_next() Chelsy Ratnawat
2026-10-16  5:59 ` kernel test robot

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