Skip to content

Commit

Permalink
net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
liping.zhang authored and David S. Miller committed Mar 14, 2016
1 parent 9826731 commit f3c9869
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,8 @@ int __sock_create(struct net *net, int family, int type, int protocol,
deadlock in module load.
*/
if (family == PF_INET && type == SOCK_PACKET) {
static int warned;
if (!warned) {
warned = 1;
pr_info("%s uses obsolete (PF_INET,SOCK_PACKET)\n",
current->comm);
}
pr_info_once("%s uses obsolete (PF_INET,SOCK_PACKET)\n",
current->comm);
family = PF_PACKET;
}

Expand Down

0 comments on commit f3c9869

Please sign in to comment.