From: "liping.zhang" <zlpwmdx@163.com>
To: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: "liping.zhang" <liping.zhang@spreadtrum.com>
Subject: [PATCH] net: socket: use pr_info_once to tip the obsolete usage of PF_PACKET
Date: Fri, 11 Mar 2016 23:08:36 +0800 [thread overview]
Message-ID: <1457708916-4462-1-git-send-email-zlpwmdx@163.com> (raw)
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
reply other threads:[~2016-03-11 15:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457708916-4462-1-git-send-email-zlpwmdx@163.com \
--to=zlpwmdx@163.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=liping.zhang@spreadtrum.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).