From patchwork Tue Oct 15 11:45:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 3044751 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17856BF924 for ; Tue, 15 Oct 2013 12:03:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECC25201FA for ; Tue, 15 Oct 2013 12:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8B9B2017B for ; Tue, 15 Oct 2013 12:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932397Ab3JOL6I (ORCPT ); Tue, 15 Oct 2013 07:58:08 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:4993 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932284Ab3JOL6C (ORCPT ); Tue, 15 Oct 2013 07:58:02 -0400 Received: from 172.24.2.119 (EHLO szxeml208-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BKI15876; Tue, 15 Oct 2013 19:57:41 +0800 (CST) Received: from SZXEML405-HUB.china.huawei.com (10.82.67.60) by szxeml208-edg.china.huawei.com (172.24.2.57) with Microsoft SMTP Server (TLS) id 14.3.146.0; Tue, 15 Oct 2013 19:57:39 +0800 Received: from localhost (10.135.68.221) by szxeml405-hub.china.huawei.com (10.82.67.60) with Microsoft SMTP Server id 14.3.146.0; Tue, 15 Oct 2013 19:57:33 +0800 From: Kefeng Wang To: CC: Greg Kroah-Hartman , "David S. Miller" , Pablo Neira Ayuso , "Stephen Hemminger" , Johannes Berg , "John W. Linville" , Stanislaw Gruszka , Johannes Berg , Francois Romieu , "Ben Hutchings" , Chas Williams , Marc Kleine-Budde , Samuel Ortiz , Paul Mackerras , Oliver Neukum , Konrad Rzeszutek Wilk , "Boris Ostrovsky" , David Vrabel , Rusty Russell , "Michael S. Tsirkin" , , , , Subject: [PATCH 08/18] atm: use wrapper functions of net_ratelimit() to simplify code Date: Tue, 15 Oct 2013 19:45:04 +0800 Message-ID: <1381837514-50660-9-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.8.3.msysgit.0 In-Reply-To: <1381837514-50660-1-git-send-email-wangkefeng.wang@huawei.com> References: <1381837514-50660-1-git-send-email-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.68.221] X-CFilter-Loop: Reflected Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP net_ratelimited_function() is called to simplify code. Signed-off-by: Kefeng Wang --- 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));