af_unix: move proto info out of CONFIG_BPF_SYSCALL
Subsystems (3)
PATCH 1/1 af_unix: move proto info out of CONFIG_BPF_SYSCALL
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.
--- net/unix/af_unix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.h +1 -1
@@ -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 );
Signature · 1 line
2.37.2.352.g3c44437643
Quoted 4 lines · Ben Dooks
These two structs are defined even if
CONFIG_BPF_SYSCALLbut the header does not export them, so declare them anyway and move the check forCONFIG_BPF_SYSCALLlower into the file.
Quoted 8 lines
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_SYSCALLconfiguration.Signed-off-by Ben Dooks <[email protected]>
Probably this is net-next material and if so should be reposted once net-next reopens next week.