Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355973 > unrolled thread

[PATCH] net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET

Started by"liping.zhang" <zlpwmdx@163.com>
First post2016-03-11 16:10 +0100
Last post2016-03-11 16:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET "liping.zhang" <zlpwmdx@163.com> - 2016-03-11 16:10 +0100

#1355973 — [PATCH] net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET

From"liping.zhang" <zlpwmdx@163.com>
Date2016-03-11 16:10 +0100
Subject[PATCH] net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET
Message-ID<rbwRr-7YD-5@gated-at.bofh.it>
From: "liping.zhang" <liping.zhang@spreadtrum.com>

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>
---
 net/socket.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index c044d1e..c499784 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1106,12 +1106,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;
 	}
 
-- 
1.7.9.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web