From: liping.zhang Date: Fri, 11 Mar 2016 15:08:36 +0000 (+0800) Subject: net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f3c986908cc3b369b57f75de306c635a0074b76b;p=linux-beck.git 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 Signed-off-by: David S. Miller --- 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, 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; }