diff options
author | liping.zhang <liping.zhang@spreadtrum.com> | 2016-03-11 10:08:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-13 22:37:50 -0400 |
commit | f3c986908cc3b369b57f75de306c635a0074b76b (patch) | |
tree | 392f58010c2644c944a65807baf97da0064e40ba | |
parent | 98267311fe3b334ae7c107fa0e2413adcf3ba735 (diff) |
net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET
There is no need to use the static variable here, pr_info_once is more
concise.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/socket.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/socket.c b/net/socket.c index 886649c88d8f..c5ddc52cf2b2 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1107,12 +1107,8 @@ int __sock_create(struct net *net, int family, int type, int protocol, | |||
1107 | deadlock in module load. | 1107 | deadlock in module load. |
1108 | */ | 1108 | */ |
1109 | if (family == PF_INET && type == SOCK_PACKET) { | 1109 | if (family == PF_INET && type == SOCK_PACKET) { |
1110 | static int warned; | 1110 | pr_info_once("%s uses obsolete (PF_INET,SOCK_PACKET)\n", |
1111 | if (!warned) { | 1111 | current->comm); |
1112 | warned = 1; | ||
1113 | pr_info("%s uses obsolete (PF_INET,SOCK_PACKET)\n", | ||
1114 | current->comm); | ||
1115 | } | ||
1116 | family = PF_PACKET; | 1112 | family = PF_PACKET; |
1117 | } | 1113 | } |
1118 | 1114 | ||