Skip to content

Commit f3c9869

Browse files
liping.zhangdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9826731 commit f3c9869

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

net/socket.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,12 +1107,8 @@ int __sock_create(struct net *net, int family, int type, int protocol,
11071107
deadlock in module load.
11081108
*/
11091109
if (family == PF_INET && type == SOCK_PACKET) {
1110-
static int warned;
1111-
if (!warned) {
1112-
warned = 1;
1113-
pr_info("%s uses obsolete (PF_INET,SOCK_PACKET)\n",
1114-
current->comm);
1115-
}
1110+
pr_info_once("%s uses obsolete (PF_INET,SOCK_PACKET)\n",
1111+
current->comm);
11161112
family = PF_PACKET;
11171113
}
11181114

0 commit comments

Comments
 (0)