提交 f3c98690 编写于 作者: L liping.zhang 提交者: David S. Miller

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: NLiping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 98267311
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册