lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1381837514-50660-9-git-send-email-wangkefeng.wang@huawei.com>
Date:	Tue, 15 Oct 2013 19:45:04 +0800
From:	Kefeng Wang <wangkefeng.wang@...wei.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	"Stephen Hemminger" <stephen@...workplumber.org>,
	Johannes Berg <johannes@...solutions.net>,
	"John W. Linville" <linville@...driver.com>,
	Stanislaw Gruszka <sgruszka@...hat.com>,
	Johannes Berg <johannes.berg@...el.com>,
	Francois Romieu <romieu@...zoreil.com>,
	"Ben Hutchings" <bhutchings@...arflare.com>,
	Chas Williams <chas@....nrl.navy.mil>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	Samuel Ortiz <samuel@...tiz.org>,
	Paul Mackerras <paulus@...ba.org>,
	Oliver Neukum <oneukum@...e.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
	David Vrabel <david.vrabel@...rix.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Michael S. Tsirkin" <mst@...hat.com>, <netfilter@...r.kernel.org>,
	<netdev@...r.kernel.org>, <linux-wireless@...r.kernel.org>,
	<guohanjun@...wei.com>
Subject: [PATCH 08/18] atm: use wrapper functions of net_ratelimit() to simplify code

net_ratelimited_function() is called to simplify code.

Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 drivers/atm/solos-pci.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 32784d1..a4d20e9 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -807,8 +807,8 @@ void solos_bh(unsigned long card_arg)
 
 				skb = alloc_skb(size + 1, GFP_ATOMIC);
 				if (!skb) {
-					if (net_ratelimit())
-						dev_warn(&card->dev->dev, "Failed to allocate sk_buff for RX\n");
+					net_ratelimited_function(dev_warn, &card->dev->dev,
+						"Failed to allocate sk_buff for RX\n");
 					continue;
 				}
 
@@ -829,8 +829,8 @@ void solos_bh(unsigned long card_arg)
 				vcc = find_vcc(card->atmdev[port], le16_to_cpu(header->vpi),
 					       le16_to_cpu(header->vci));
 				if (!vcc) {
-					if (net_ratelimit())
-						dev_warn(&card->dev->dev, "Received packet for unknown VPI.VCI %d.%d on port %d\n",
+					net_ratelimited_function(dev_warn, &card->dev->dev,
+						"Received packet for unknown VPI.VCI %d.%d on port %d\n",
 							 le16_to_cpu(header->vpi), le16_to_cpu(header->vci),
 							 port);
 					dev_kfree_skb_any(skb);
@@ -856,9 +856,8 @@ void solos_bh(unsigned long card_arg)
 					break;
 				spin_lock(&card->cli_queue_lock);
 				if (skb_queue_len(&card->cli_queue[port]) > 10) {
-					if (net_ratelimit())
-						dev_warn(&card->dev->dev, "Dropping console response on port %d\n",
-							 port);
+					net_ratelimited_function(dev_warn, &card->dev->dev,
+						"Dropping console response on port %d\n", port);
 					dev_kfree_skb_any(skb);
 				} else
 					skb_queue_tail(&card->cli_queue[port], skb);
@@ -878,8 +877,7 @@ void solos_bh(unsigned long card_arg)
 					  card->config_regs + RX_DMA_ADDR(port));
 				card->rx_skb[port] = skb;
 			} else {
-				if (net_ratelimit())
-					dev_warn(&card->dev->dev, "Failed to allocate RX skb");
+				net_ratelimited_function(dev_warn, &card->dev->dev, "Failed to allocate RX skb");
 
 				/* We'll have to try again later */
 				tasklet_schedule(&card->tlet);
@@ -927,8 +925,8 @@ static int popen(struct atm_vcc *vcc)
 
 	skb = alloc_skb(sizeof(*header), GFP_KERNEL);
 	if (!skb) {
-		if (net_ratelimit())
-			dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
+		net_ratelimited_function(dev_warn, &card->dev->dev,
+			"Failed to allocate sk_buff in popen()\n");
 		return -ENOMEM;
 	}
 	header = (void *)skb_put(skb, sizeof(*header));
-- 
1.8.2.1


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ