From: Miaohe Lin Date: Wed, 19 Aug 2020 08:32:08 +0000 (-0400) Subject: net: Stop warning about SO_BSDCOMPAT usage X-Git-Tag: v5.15~2655^2~483 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4ecc748533d5ef13ccb40beda2d5a68832a5259;p=platform%2Fkernel%2Flinux-starfive.git net: Stop warning about SO_BSDCOMPAT usage We've been warning about SO_BSDCOMPAT usage for many years. We may remove this code completely now. Suggested-by: David S. Miller Signed-off-by: Miaohe Lin Signed-off-by: David S. Miller --- diff --git a/net/core/sock.c b/net/core/sock.c index e4f40b17..64d2aec 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -413,18 +413,6 @@ static int sock_set_timeout(long *timeo_p, sockptr_t optval, int optlen, return 0; } -static void sock_warn_obsolete_bsdism(const char *name) -{ - static int warned; - static char warncomm[TASK_COMM_LEN]; - if (strcmp(warncomm, current->comm) && warned < 5) { - strcpy(warncomm, current->comm); - pr_warn("process `%s' is using obsolete %s SO_BSDCOMPAT\n", - warncomm, name); - warned++; - } -} - static bool sock_needs_netstamp(const struct sock *sk) { switch (sk->sk_family) { @@ -984,7 +972,6 @@ set_sndbuf: break; case SO_BSDCOMPAT: - sock_warn_obsolete_bsdism("setsockopt"); break; case SO_PASSCRED: @@ -1387,7 +1374,6 @@ int sock_getsockopt(struct socket *sock, int level, int optname, break; case SO_BSDCOMPAT: - sock_warn_obsolete_bsdism("getsockopt"); break; case SO_TIMESTAMP_OLD: