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-11-git-send-email-wangkefeng.wang@huawei.com>
Date:	Tue, 15 Oct 2013 19:45:06 +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 10/18] net: peak_usb: 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/net/can/usb/peak_usb/pcan_usb_core.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 0b7a4c3..5166a1f 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -191,8 +191,7 @@ static void peak_usb_read_bulk_callback(struct urb *urb)
 		return;
 
 	default:
-		if (net_ratelimit())
-			netdev_err(netdev,
+		net_ratelimited_function(netdev_err, netdev,
 				   "Rx urb aborted (%d)\n", urb->status);
 		goto resubmit_urb;
 	}
@@ -260,9 +259,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
 		break;
 
 	default:
-		if (net_ratelimit())
-			netdev_err(netdev, "Tx urb aborted (%d)\n",
-				   urb->status);
+		net_ratelimited_function(netdev_err, netdev,
+			"Tx urb aborted (%d)\n", urb->status);
 	case -EPROTO:
 	case -ENOENT:
 	case -ECONNRESET:
@@ -314,8 +312,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
 
 	err = dev->adapter->dev_encode_msg(dev, skb, obuf, &size);
 	if (err) {
-		if (net_ratelimit())
-			netdev_err(netdev, "packet dropped\n");
+		net_ratelimited_function(netdev_err, netdev, "packet dropped\n");
 		dev_kfree_skb(skb);
 		stats->tx_dropped++;
 		return NETDEV_TX_OK;
-- 
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