From patchwork Sun Aug 9 19:54:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Slusarz X-Patchwork-Id: 31043 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 565B5B7B6F for ; Mon, 10 Aug 2009 05:58:26 +1000 (EST) Received: by ozlabs.org (Postfix) id 4B251DDD0B; Mon, 10 Aug 2009 05:58:26 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C7171DDD04 for ; Mon, 10 Aug 2009 05:58:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753409AbZHITzT (ORCPT ); Sun, 9 Aug 2009 15:55:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753588AbZHITzR (ORCPT ); Sun, 9 Aug 2009 15:55:17 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:23922 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753485AbZHITzN (ORCPT ); Sun, 9 Aug 2009 15:55:13 -0400 Received: by fg-out-1718.google.com with SMTP id e21so641206fga.17 for ; Sun, 09 Aug 2009 12:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=polwgNrVpKA7Uw4/kkbVu6V1Z9SSAmft/ASPo3WxOsk=; b=apSKSkAz9LO5ezwc5IVRoxZyu+9cS8K2rOGpjVRomr+8YGhnVXP3iAX9IWMO7Knift sYpZb2xm12whWxI7Jen7miMfheW/EscLeigRj7H5KGUT8RiAjDvyGhq28+NPSSXNdpBg ScNX9wdFEdkRN8DMjeKqxhJK47v/e4ds0Zfas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Jdv8z975m8xhkCmNK2gwKVOGTFCCTew+2lsHJmal2F/OiWHyI7vxLWtpe6leySLvKE DIzP25u9EFlkRTJu+HzpXC6oCLakRS/+oEYSR5ynqW54JFzyoWsfK/T1byeol8GE5dD5 UJGO94fow/XZKgmZrCRuZuAGKtHHjdruCUEsc= Received: by 10.86.84.16 with SMTP id h16mr2628519fgb.36.1249847714005; Sun, 09 Aug 2009 12:55:14 -0700 (PDT) Received: from joi (bfq40.neoplus.adsl.tpnet.pl [83.28.54.40]) by mx.google.com with ESMTPS id l19sm10012180fgb.22.2009.08.09.12.55.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 09 Aug 2009 12:55:13 -0700 (PDT) Received: by joi (sSMTP sendmail emulation); Sun, 09 Aug 2009 21:55:11 +0200 From: Marcin Slusarz To: LKML Cc: "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH 14/14] net: use printk_once Date: Sun, 9 Aug 2009 21:54:09 +0200 Message-Id: <1249847649-11631-15-git-send-email-marcin.slusarz@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1249847649-11631-1-git-send-email-marcin.slusarz@gmail.com> References: <1249847649-11631-1-git-send-email-marcin.slusarz@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Marcin Slusarz Cc: "David S. Miller" Cc: netdev@vger.kernel.org Acked-by: David S. Miller --- net/ax25/af_ax25.c | 6 +----- net/dsa/dsa.c | 4 +--- net/ipv4/raw.c | 6 ++---- net/netfilter/xt_recent.c | 10 +++------- net/socket.c | 8 ++------ 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index da0f64f..39c895b 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1792,12 +1792,8 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) /* old structure? */ if (cmd == SIOCAX25GETINFOOLD) { - static int warned = 0; - if (!warned) { - printk(KERN_INFO "%s uses old SIOCAX25GETINFO\n", + printk_once(KERN_INFO "%s uses old SIOCAX25GETINFO\n", current->comm); - warned=1; - } if (copy_to_user(argp, &ax25_info, sizeof(struct ax25_info_struct_deprecated))) { res = -EFAULT; diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 71489f6..ecd2dfb 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -302,14 +302,12 @@ static struct net_device *dev_to_net_device(struct device *dev) static int dsa_probe(struct platform_device *pdev) { - static int dsa_version_printed; struct dsa_platform_data *pd = pdev->dev.platform_data; struct net_device *dev; struct dsa_switch_tree *dst; int i; - if (!dsa_version_printed++) - printk(KERN_NOTICE "Distributed Switch Architecture " + printk_once(KERN_NOTICE "Distributed Switch Architecture " "driver version %s\n", dsa_driver_version); if (pd == NULL || pd->netdev == NULL) diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 2979f14..f919925 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -470,10 +470,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, if (msg->msg_namelen < sizeof(*usin)) goto out; if (usin->sin_family != AF_INET) { - static int complained; - if (!complained++) - printk(KERN_INFO "%s forgot to set AF_INET in " - "raw sendmsg. Fix it!\n", + printk_once(KERN_INFO "%s forgot to set AF_INET in " + "raw sendmsg. Fix it!\n", current->comm); err = -EAFNOSUPPORT; if (usin->sin_family) diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index eb0ceb8..d60d317 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c @@ -456,13 +456,9 @@ static int recent_seq_open(struct inode *inode, struct file *file) #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT static int recent_old_seq_open(struct inode *inode, struct file *filp) { - static bool warned_of_old; - - if (unlikely(!warned_of_old)) { - printk(KERN_INFO KBUILD_MODNAME ": Use of /proc/net/ipt_recent" - " is deprecated; use /proc/net/xt_recent.\n"); - warned_of_old = true; - } + printk_once(KERN_INFO KBUILD_MODNAME ": " + "Use of /proc/net/ipt_recent is deprecated; " + "use /proc/net/xt_recent.\n"); return recent_seq_open(inode, filp); } diff --git a/net/socket.c b/net/socket.c index 791d71a..1d07f69 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1161,12 +1161,8 @@ static 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; - printk(KERN_INFO "%s uses obsolete (PF_INET,SOCK_PACKET)\n", - current->comm); - } + printk_once(KERN_INFO "%s uses obsolete (PF_INET,SOCK_PACKET)\n", + current->comm); family = PF_PACKET; }