The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] af_unix: move proto info out of CONFIG_BPF_SYSCALL
@ 2026-06-23 12:49 Ben Dooks
  2026-06-24 18:20 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2026-06-23 12:49 UTC (permalink / raw)
  To: Kuniyuki Iwashima, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel
  Cc: Ben Dooks

These two structs are defined even if CONFIG_BPF_SYSCALL but
the header does not export them, so declare them anyway and
move the check for CONFIG_BPF_SYSCALL lower into the file.

This removes the two sparse warnings:
net/unix/af_unix.c:1060:14: warning: symbol 'unix_dgram_proto' was not declared. Should it be static?
net/unix/af_unix.c:1071:14: warning: symbol 'unix_stream_proto' was not declared. Should it be static?

This change is less complicated than trying to make those two
structs static based on the CONFIG_BPF_SYSCALL configuration.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 net/unix/af_unix.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/unix/af_unix.h b/net/unix/af_unix.h
index 8119dbeef3a3..2a6a26b3a2db 100644
--- a/net/unix/af_unix.h
+++ b/net/unix/af_unix.h
@@ -55,10 +55,10 @@ static inline void unix_sysctl_unregister(struct net *net)
 int __unix_dgram_recvmsg(struct sock *sk, struct msghdr *msg, size_t size, int flags);
 int __unix_stream_recvmsg(struct sock *sk, struct msghdr *msg, size_t size, int flags);
 
-#ifdef CONFIG_BPF_SYSCALL
 extern struct proto unix_dgram_proto;
 extern struct proto unix_stream_proto;
 
+#ifdef CONFIG_BPF_SYSCALL
 int unix_dgram_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
 int unix_stream_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
 void __init unix_bpf_build_proto(void);
-- 
2.37.2.352.g3c44437643


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

* Re: [PATCH] af_unix: move proto info out of CONFIG_BPF_SYSCALL
  2026-06-23 12:49 [PATCH] af_unix: move proto info out of CONFIG_BPF_SYSCALL Ben Dooks
@ 2026-06-24 18:20 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-06-24 18:20 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Kuniyuki Iwashima, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Tue, Jun 23, 2026 at 01:49:40PM +0100, Ben Dooks wrote:
> These two structs are defined even if CONFIG_BPF_SYSCALL but
> the header does not export them, so declare them anyway and
> move the check for CONFIG_BPF_SYSCALL lower into the file.
> 
> This removes the two sparse warnings:
> net/unix/af_unix.c:1060:14: warning: symbol 'unix_dgram_proto' was not declared. Should it be static?
> net/unix/af_unix.c:1071:14: warning: symbol 'unix_stream_proto' was not declared. Should it be static?
> 
> This change is less complicated than trying to make those two
> structs static based on the CONFIG_BPF_SYSCALL configuration.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Reviewed-by: Simon Horman <horms@kernel.org>

Probably this is net-next material and if so
should be reposted once net-next reopens next week.

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

end of thread, other threads:[~2026-06-24 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 12:49 [PATCH] af_unix: move proto info out of CONFIG_BPF_SYSCALL Ben Dooks
2026-06-24 18:20 ` Simon Horman

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