mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chia-Liang Wang <wjliang627@gmail.com>
To: edumazet@google.com, kuniyu@google.com, pabeni@redhat.com,
	willemb@google.com, davem@davemloft.net, kuba@kernel.org
Cc: horms@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Chia-Liang Wang <a0979625527@icloud.com>
Subject: [PATCH] net: socket: add missing declaration for update_socket_protocol
Date: Sat, 22 Nov 2025 13:10:21 +0800	[thread overview]
Message-ID: <20251122051021.19709-1-a0979625527@icloud.com> (raw)

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.

Signed-off-by: Chia-Liang Wang <a0979625527@icloud.com>
---
 include/net/sock.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/net/sock.h b/include/net/sock.h
index 60bcb13f045c..2081b6599edc 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -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


             reply	other threads:[~2025-11-22  5:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22  5:10 Chia-Liang Wang [this message]
2025-11-22  5:44 ` Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251122051021.19709-1-a0979625527@icloud.com \
    --to=wjliang627@gmail.com \
    --cc=a0979625527@icloud.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®