]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: octeon: use printk_ratelimited instead of printk_ratelimit
authorChristian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Sat, 4 Jun 2011 15:35:58 +0000 (17:35 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jun 2011 21:29:19 +0000 (14:29 -0700)
As per printk_ratelimit comment, it should not be used

Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/octeon/ethernet-mdio.c
drivers/staging/octeon/ethernet-rgmii.c
drivers/staging/octeon/ethernet-rx.c
drivers/staging/octeon/ethernet-sgmii.c
drivers/staging/octeon/ethernet-tx.c
drivers/staging/octeon/ethernet-util.h
drivers/staging/octeon/ethernet-xaui.c

index 8a11ffcd7de89188252cda18d3841174e6802c59..f18e3e140413c4a0a5b5a48197c5a1e08557c134 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
 #include <linux/phy.h>
+#include <linux/ratelimit.h>
 
 #include <net/dst.h>
 
@@ -129,22 +130,22 @@ static void cvm_oct_adjust_link(struct net_device *dev)
                if (priv->last_link) {
                        netif_carrier_on(dev);
                        if (priv->queue != -1)
-                               DEBUGPRINT("%s: %u Mbps %s duplex, "
-                                          "port %2d, queue %2d\n",
-                                          dev->name, priv->phydev->speed,
-                                          priv->phydev->duplex ?
-                                               "Full" : "Half",
-                                          priv->port, priv->queue);
+                               printk_ratelimited("%s: %u Mbps %s duplex, "
+                                                  "port %2d, queue %2d\n",
+                                                  dev->name, priv->phydev->speed,
+                                                  priv->phydev->duplex ?
+                                                  "Full" : "Half",
+                                                  priv->port, priv->queue);
                        else
-                               DEBUGPRINT("%s: %u Mbps %s duplex, "
-                                          "port %2d, POW\n",
-                                          dev->name, priv->phydev->speed,
-                                          priv->phydev->duplex ?
-                                               "Full" : "Half",
-                                          priv->port);
+                               printk_ratelimited("%s: %u Mbps %s duplex, "
+                                                  "port %2d, POW\n",
+                                                  dev->name, priv->phydev->speed,
+                                                  priv->phydev->duplex ?
+                                                  "Full" : "Half",
+                                                  priv->port);
                } else {
                        netif_carrier_off(dev);
-                       DEBUGPRINT("%s: Link down\n", dev->name);
+                       printk_ratelimited("%s: Link down\n", dev->name);
                }
        }
 }
index a0d4d4b98bdc95d4a2b83d9da4ea2398163f200f..9c0d2936e4862e2d3c8888fa8618e12416966212 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/phy.h>
+#include <linux/ratelimit.h>
 #include <net/dst.h>
 
 #include <asm/octeon/octeon.h>
@@ -116,9 +117,9 @@ static void cvm_oct_rgmii_poll(struct net_device *dev)
                                cvmx_write_csr(CVMX_GMXX_RXX_INT_REG
                                               (index, interface),
                                               gmxx_rxx_int_reg.u64);
-                               DEBUGPRINT("%s: Using 10Mbps with software "
-                                          "preamble removal\n",
-                                    dev->name);
+                               printk_ratelimited("%s: Using 10Mbps with software "
+                                                  "preamble removal\n",
+                                                  dev->name);
                        }
                }
 
@@ -174,23 +175,23 @@ static void cvm_oct_rgmii_poll(struct net_device *dev)
                        if (!netif_carrier_ok(dev))
                                netif_carrier_on(dev);
                        if (priv->queue != -1)
-                               DEBUGPRINT("%s: %u Mbps %s duplex, "
-                                          "port %2d, queue %2d\n",
-                                          dev->name, link_info.s.speed,
-                                          (link_info.s.full_duplex) ?
-                                               "Full" : "Half",
-                                          priv->port, priv->queue);
+                               printk_ratelimited("%s: %u Mbps %s duplex, "
+                                                  "port %2d, queue %2d\n",
+                                                  dev->name, link_info.s.speed,
+                                                  (link_info.s.full_duplex) ?
+                                                  "Full" : "Half",
+                                                  priv->port, priv->queue);
                        else
-                               DEBUGPRINT("%s: %u Mbps %s duplex, "
-                                          "port %2d, POW\n",
-                                          dev->name, link_info.s.speed,
-                                          (link_info.s.full_duplex) ?
-                                               "Full" : "Half",
-                                          priv->port);
+                               printk_ratelimited("%s: %u Mbps %s duplex, "
+                                                  "port %2d, POW\n",
+                                                  dev->name, link_info.s.speed,
+                                                  (link_info.s.full_duplex) ?
+                                                  "Full" : "Half",
+                                                  priv->port);
                } else {
                        if (netif_carrier_ok(dev))
                                netif_carrier_off(dev);
-                       DEBUGPRINT("%s: Link down\n", dev->name);
+                       printk_ratelimited("%s: Link down\n", dev->name);
                }
        }
 }
index cb38f9eb2cc079c6822485cc225dcc9fe5bf049c..0f22f0f47446baf833c36e29a99105d639f3dcb5 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/ip.h>
 #include <linux/string.h>
 #include <linux/prefetch.h>
+#include <linux/ratelimit.h>
 #include <linux/smp.h>
 #include <net/dst.h>
 #ifdef CONFIG_XFRM
@@ -186,13 +187,13 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
 
                        if (*ptr == 0xd5) {
                                /*
-                                  DEBUGPRINT("Port %d received 0xd5 preamble\n", work->ipprt);
+                                 printk_ratelimited("Port %d received 0xd5 preamble\n", work->ipprt);
                                 */
                                work->packet_ptr.s.addr += i + 1;
                                work->len -= i + 5;
                        } else if ((*ptr & 0xf) == 0xd) {
                                /*
-                                  DEBUGPRINT("Port %d received 0x?d preamble\n", work->ipprt);
+                                 printk_ratelimited("Port %d received 0x?d preamble\n", work->ipprt);
                                 */
                                work->packet_ptr.s.addr += i;
                                work->len -= i + 4;
@@ -203,9 +204,9 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
                                        ptr++;
                                }
                        } else {
-                               DEBUGPRINT("Port %d unknown preamble, packet "
-                                          "dropped\n",
-                                    work->ipprt);
+                               printk_ratelimited("Port %d unknown preamble, packet "
+                                                  "dropped\n",
+                                                  work->ipprt);
                                /*
                                   cvmx_helper_dump_packet(work);
                                 */
@@ -214,8 +215,8 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
                        }
                }
        } else {
-               DEBUGPRINT("Port %d receive error code %d, packet dropped\n",
-                          work->ipprt, work->word2.snoip.err_code);
+               printk_ratelimited("Port %d receive error code %d, packet dropped\n",
+                                  work->ipprt, work->word2.snoip.err_code);
                cvm_oct_free_work(work);
                return 1;
        }
@@ -334,8 +335,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                         */
                        skb = dev_alloc_skb(work->len);
                        if (!skb) {
-                               DEBUGPRINT("Port %d failed to allocate skbuff, packet dropped\n",
-                                          work->ipprt);
+                               printk_ratelimited("Port %d failed to allocate "
+                                                  "skbuff, packet dropped\n",
+                                                  work->ipprt);
                                cvm_oct_free_work(work);
                                continue;
                        }
@@ -429,7 +431,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                        } else {
                                /* Drop any packet received for a device that isn't up */
                                /*
-                               DEBUGPRINT("%s: Device not up, packet dropped\n",
+                                 printk_ratelimited("%s: Device not up, packet dropped\n",
                                           dev->name);
                                */
 #ifdef CONFIG_64BIT
@@ -444,7 +446,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                         * Drop any packet received for a device that
                         * doesn't exist.
                         */
-                       DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n",
+                       printk_ratelimited("Port %d not controlled by Linux, packet dropped\n",
                                   work->ipprt);
                        dev_kfree_skb_irq(skb);
                }
index 2d8589eb461e9cdf3fdfc1ace1dc552f930a91d3..5e148b512c97590ece781be25c61801731a18696 100644 (file)
@@ -26,6 +26,7 @@
 **********************************************************************/
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/ratelimit.h>
 #include <net/dst.h>
 
 #include <asm/octeon/octeon.h>
@@ -90,20 +91,21 @@ static void cvm_oct_sgmii_poll(struct net_device *dev)
                if (!netif_carrier_ok(dev))
                        netif_carrier_on(dev);
                if (priv->queue != -1)
-                       DEBUGPRINT
+                       printk_ratelimited
                            ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
                             dev->name, link_info.s.speed,
                             (link_info.s.full_duplex) ? "Full" : "Half",
                             priv->port, priv->queue);
                else
-                       DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n",
-                                  dev->name, link_info.s.speed,
-                                  (link_info.s.full_duplex) ? "Full" : "Half",
-                                  priv->port);
+                       printk_ratelimited
+                               ("%s: %u Mbps %s duplex, port %2d, POW\n",
+                                dev->name, link_info.s.speed,
+                                (link_info.s.full_duplex) ? "Full" : "Half",
+                                priv->port);
        } else {
                if (netif_carrier_ok(dev))
                        netif_carrier_off(dev);
-               DEBUGPRINT("%s: Link down\n", dev->name);
+               printk_ratelimited("%s: Link down\n", dev->name);
        }
 }
 
index afc2b734d554fdd598292ccb42eb67af42fac56b..6227571149f5a5975e0cdb9d56c4317dcc63893b 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/init.h>
 #include <linux/etherdevice.h>
 #include <linux/ip.h>
+#include <linux/ratelimit.h>
 #include <linux/string.h>
 #include <net/dst.h>
 #ifdef CONFIG_XFRM
@@ -446,7 +447,7 @@ dont_put_skbuff_in_hw:
                                                 priv->queue + qos,
                                                 pko_command, hw_buffer,
                                                 CVMX_PKO_LOCK_NONE))) {
-               DEBUGPRINT("%s: Failed to send the packet\n", dev->name);
+               printk_ratelimited("%s: Failed to send the packet\n", dev->name);
                queue_type = QUEUE_DROP;
        }
 skip_xmit:
@@ -525,8 +526,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
        /* Get a work queue entry */
        cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
        if (unlikely(work == NULL)) {
-               DEBUGPRINT("%s: Failed to allocate a work queue entry\n",
-                          dev->name);
+               printk_ratelimited("%s: Failed to allocate a work "
+                                  "queue entry\n", dev->name);
                priv->stats.tx_dropped++;
                dev_kfree_skb(skb);
                return 0;
@@ -535,8 +536,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
        /* Get a packet buffer */
        packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
        if (unlikely(packet_buffer == NULL)) {
-               DEBUGPRINT("%s: Failed to allocate a packet buffer\n",
-                          dev->name);
+               printk_ratelimited("%s: Failed to allocate a packet buffer\n",
+                                  dev->name);
                cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
                priv->stats.tx_dropped++;
                dev_kfree_skb(skb);
index c745a72a05940e9c4d3d6c4e90af03e0df20ffcc..144fb99bf50cab8f88a83c070bbe1e05de8bbcfe 100644 (file)
  * Contact Cavium Networks for more information
 *********************************************************************/
 
-#define DEBUGPRINT(format, ...) do { if (printk_ratelimit())           \
-                                       printk(format, ##__VA_ARGS__);  \
-                               } while (0)
-
 /**
  * cvm_oct_get_buffer_ptr - convert packet data address to pointer
  * @packet_ptr: Packet data hardware address
index 3fca1cc31ed82dfc79bcaf1cf72b177694c110c0..861a4b3fe8576db59088fe0d4f8191a6c43f80b4 100644 (file)
@@ -26,6 +26,7 @@
 **********************************************************************/
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/ratelimit.h>
 #include <net/dst.h>
 
 #include <asm/octeon/octeon.h>
@@ -89,20 +90,21 @@ static void cvm_oct_xaui_poll(struct net_device *dev)
                if (!netif_carrier_ok(dev))
                        netif_carrier_on(dev);
                if (priv->queue != -1)
-                       DEBUGPRINT
-                           ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
-                            dev->name, link_info.s.speed,
-                            (link_info.s.full_duplex) ? "Full" : "Half",
-                            priv->port, priv->queue);
+                       printk_ratelimited
+                               ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
+                                dev->name, link_info.s.speed,
+                                (link_info.s.full_duplex) ? "Full" : "Half",
+                                priv->port, priv->queue);
                else
-                       DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n",
-                                  dev->name, link_info.s.speed,
-                                  (link_info.s.full_duplex) ? "Full" : "Half",
-                                  priv->port);
+                       printk_ratelimited
+                               ("%s: %u Mbps %s duplex, port %2d, POW\n",
+                                dev->name, link_info.s.speed,
+                                (link_info.s.full_duplex) ? "Full" : "Half",
+                                priv->port);
        } else {
                if (netif_carrier_ok(dev))
                        netif_carrier_off(dev);
-               DEBUGPRINT("%s: Link down\n", dev->name);
+               printk_ratelimited("%s: Link down\n", dev->name);
        }
 }