Patchwork [11/18] net: hamradio: use wrapper functions of net_ratelimit() to simplify code

login
register
mail settings
Submitter Kefeng Wang
Date Oct. 15, 2013, 11:45 a.m.
Message ID <1381837514-50660-12-git-send-email-wangkefeng.wang@huawei.com>
Download mbox | patch
Permalink /patch/283610/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Kefeng Wang - Oct. 15, 2013, 11:45 a.m.
net_XXX_ratelimited() is called to simplify code.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/net/hamradio/6pack.c    | 3 +--
 drivers/net/hamradio/bpqether.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 1450e33..9e97eba 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -237,8 +237,7 @@  static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len)
 out_drop:
 	sp->dev->stats.tx_dropped++;
 	netif_start_queue(sp->dev);
-	if (net_ratelimit())
-		printk(KERN_DEBUG "%s: %s - dropped.\n", sp->dev->name, msg);
+	net_dbg_ratelimited("%s: %s - dropped.\n", sp->dev->name, msg);
 }
 
 /* Encapsulate an IP datagram and kick it into a TTY queue. */
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index f91bf0d..1522b4a 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -269,8 +269,7 @@  static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * space for the BPQ headers.
 	 */
 	if (skb_cow(skb, AX25_BPQ_HEADER_LEN)) {
-		if (net_ratelimit())
-			pr_err("bpqether: out of memory\n");
+		net_err_ratelimited("pqether: out of memory\n");
 		kfree_skb(skb);
 
 		return NETDEV_TX_OK;