]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
udp: Make udp[46]_seq_show() static.
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 11 Mar 2026 05:19:48 +0000 (05:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Mar 2026 01:57:44 +0000 (18:57 -0700)
Since commit a3d2599b2446 ("ipv{4,6}/udp{,lite}: simplify proc
registration"), udp4_seq_show() and udp6_seq_show() are not
used in net/ipv4/udplite.c and net/ipv6/udplite.c.

Instead, udp_seq_ops and udp6_seq_ops are exposed to UDP-Lite.

Let's make udp4_seq_show() and udp6_seq_show() static.

udp_seq_ops and udp6_seq_ops are moved to udp_impl.h so that
we can make them static when the header is removed.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260311052020.1213705-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/udp.h
net/ipv4/udp.c
net/ipv4/udp_impl.h
net/ipv6/udp.c
net/ipv6/udp_impl.h

index b648003e5792a167822f28aeb728c3d64a2141f4..f51a51c0e4685dbecb611ff37f2c16de75692d8f 100644 (file)
@@ -576,9 +576,6 @@ void *udp_seq_start(struct seq_file *seq, loff_t *pos);
 void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 void udp_seq_stop(struct seq_file *seq, void *v);
 
-extern const struct seq_operations udp_seq_ops;
-extern const struct seq_operations udp6_seq_ops;
-
 int udp4_proc_init(void);
 void udp4_proc_exit(void);
 #endif /* CONFIG_PROC_FS */
index 668a0284c3d59e2f3cfadd61e725c649b17712e5..1fcdc5482594020818f0e9c2233ab9e88167d6b3 100644 (file)
@@ -3443,7 +3443,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
                sk_drops_read(sp));
 }
 
-int udp4_seq_show(struct seq_file *seq, void *v)
+static int udp4_seq_show(struct seq_file *seq, void *v)
 {
        seq_setwidth(seq, 127);
        if (v == SEQ_START_TOKEN)
@@ -3753,7 +3753,6 @@ const struct seq_operations udp_seq_ops = {
        .stop           = udp_seq_stop,
        .show           = udp4_seq_show,
 };
-EXPORT_IPV6_MOD(udp_seq_ops);
 
 static struct udp_seq_afinfo udp4_seq_afinfo = {
        .family         = AF_INET,
index 17a6fa8b14093054b39663c20af0124bc9ff79ae..0ca4384f9afa17564a62c7b272e6c5c304c59c11 100644 (file)
@@ -22,6 +22,6 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int flags);
 void udp_destroy_sock(struct sock *sk);
 
 #ifdef CONFIG_PROC_FS
-int udp4_seq_show(struct seq_file *seq, void *v);
+extern const struct seq_operations udp_seq_ops;
 #endif
 #endif /* _UDP4_IMPL_H */
index 5a3984e59c9060a6589ab7161328952fdd795ea3..5fef1c22669799e7295642332166887a877530f7 100644 (file)
@@ -1903,7 +1903,7 @@ int udpv6_getsockopt(struct sock *sk, int level, int optname,
 
 /* ------------------------------------------------------------------------ */
 #ifdef CONFIG_PROC_FS
-int udp6_seq_show(struct seq_file *seq, void *v)
+static int udp6_seq_show(struct seq_file *seq, void *v)
 {
        if (v == SEQ_START_TOKEN) {
                seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);
@@ -1924,7 +1924,6 @@ const struct seq_operations udp6_seq_ops = {
        .stop           = udp_seq_stop,
        .show           = udp6_seq_show,
 };
-EXPORT_SYMBOL(udp6_seq_ops);
 
 static struct udp_seq_afinfo udp6_seq_afinfo = {
        .family         = AF_INET6,
index 1bd4a573e1bb21145c72cac349628a2da71d1214..525ea600228ab512f73f2181a562f5cecddeca0e 100644 (file)
@@ -26,6 +26,6 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int flags);
 void udpv6_destroy_sock(struct sock *sk);
 
 #ifdef CONFIG_PROC_FS
-int udp6_seq_show(struct seq_file *seq, void *v);
+extern const struct seq_operations udp6_seq_ops;
 #endif
 #endif /* _UDP6_IMPL_H */