net: socket: add missing declaration for update_socket_protocol
Subsystems (3)
PATCH 1/1 net: socket: add missing declaration for update_socket_protocol
When building with C=1, sparse reports the following warning:
net/socket.c:1735:21: warning: symbol 'update_socket_protocol' was not declared. Should it be static?
The function update_socket_protocol() is defined as __weak, intended to be overwritten by architecture-specific implementations. Therefore, it cannot be static.
Add a declaration in include/net/sock.h to fix this sparse warning.
--- include/net/sock.h | 2 ++ 1 file changed, 2 insertions(+)
include/net/sock.h +2 -0
@@ -3103,4 +3103,6 @@ static inline bool sk_is_readable(struct sock *sk) return false; } + +int update_socket_protocol (int family,int type,int protocol);#endif /* _SOCK_H */
Signature · 1 line
2.43.0
Kuniyuki Iwashima
maintainerQuoted 10 lines · Chia-Liang Wang
When building with C=1, sparse reports the following warning:
net/socket.c:1735:21: warning: symbol 'update_socket_protocol' was not declared. Should it be static?The function
update_socket_protocol()is defined as__weak, intended to be overwritten by architecture-specific implementations. Therefore, it cannot be static.Add a declaration in
include/net/sock.hto fix this sparse warning.
Sparse just doesn't understand the context.
The function is wrapped with __bpf_hook_start() that should suppress the real warning by compilers.
Quoted 20 lines
Signed-off-by Chia-Liang Wang <[email protected]>--- include/net/sock.h | 2 ++ 1 file changed, 2 insertions(+)include/net/sock.h +2
-1@@ -3103,4 +3103,6 @@ static inline bool sk_is_readable(struct sock *sk) return false; } + +int update_socket_protocol (int family,int type,int protocol);#endif /* _SOCK_H */ --2.43.0