Commit 7a2eaf9358250706672783eb8511835706b0922b
Committed by
Greg Kroah-Hartman
1 parent
9d17653c72
Exists in
master
and in
6 other branches
staging: octeon: use printk_ratelimited instead of printk_ratelimit
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>
Showing 7 changed files with 70 additions and 65 deletions Side-by-side Diff
drivers/staging/octeon/ethernet-mdio.c
... | ... | @@ -27,6 +27,7 @@ |
27 | 27 | #include <linux/kernel.h> |
28 | 28 | #include <linux/ethtool.h> |
29 | 29 | #include <linux/phy.h> |
30 | +#include <linux/ratelimit.h> | |
30 | 31 | |
31 | 32 | #include <net/dst.h> |
32 | 33 | |
33 | 34 | |
34 | 35 | |
... | ... | @@ -129,22 +130,22 @@ |
129 | 130 | if (priv->last_link) { |
130 | 131 | netif_carrier_on(dev); |
131 | 132 | if (priv->queue != -1) |
132 | - DEBUGPRINT("%s: %u Mbps %s duplex, " | |
133 | - "port %2d, queue %2d\n", | |
134 | - dev->name, priv->phydev->speed, | |
135 | - priv->phydev->duplex ? | |
136 | - "Full" : "Half", | |
137 | - priv->port, priv->queue); | |
133 | + printk_ratelimited("%s: %u Mbps %s duplex, " | |
134 | + "port %2d, queue %2d\n", | |
135 | + dev->name, priv->phydev->speed, | |
136 | + priv->phydev->duplex ? | |
137 | + "Full" : "Half", | |
138 | + priv->port, priv->queue); | |
138 | 139 | else |
139 | - DEBUGPRINT("%s: %u Mbps %s duplex, " | |
140 | - "port %2d, POW\n", | |
141 | - dev->name, priv->phydev->speed, | |
142 | - priv->phydev->duplex ? | |
143 | - "Full" : "Half", | |
144 | - priv->port); | |
140 | + printk_ratelimited("%s: %u Mbps %s duplex, " | |
141 | + "port %2d, POW\n", | |
142 | + dev->name, priv->phydev->speed, | |
143 | + priv->phydev->duplex ? | |
144 | + "Full" : "Half", | |
145 | + priv->port); | |
145 | 146 | } else { |
146 | 147 | netif_carrier_off(dev); |
147 | - DEBUGPRINT("%s: Link down\n", dev->name); | |
148 | + printk_ratelimited("%s: Link down\n", dev->name); | |
148 | 149 | } |
149 | 150 | } |
150 | 151 | } |
drivers/staging/octeon/ethernet-rgmii.c
... | ... | @@ -27,6 +27,7 @@ |
27 | 27 | #include <linux/kernel.h> |
28 | 28 | #include <linux/netdevice.h> |
29 | 29 | #include <linux/phy.h> |
30 | +#include <linux/ratelimit.h> | |
30 | 31 | #include <net/dst.h> |
31 | 32 | |
32 | 33 | #include <asm/octeon/octeon.h> |
... | ... | @@ -116,9 +117,9 @@ |
116 | 117 | cvmx_write_csr(CVMX_GMXX_RXX_INT_REG |
117 | 118 | (index, interface), |
118 | 119 | gmxx_rxx_int_reg.u64); |
119 | - DEBUGPRINT("%s: Using 10Mbps with software " | |
120 | - "preamble removal\n", | |
121 | - dev->name); | |
120 | + printk_ratelimited("%s: Using 10Mbps with software " | |
121 | + "preamble removal\n", | |
122 | + dev->name); | |
122 | 123 | } |
123 | 124 | } |
124 | 125 | |
125 | 126 | |
126 | 127 | |
... | ... | @@ -174,23 +175,23 @@ |
174 | 175 | if (!netif_carrier_ok(dev)) |
175 | 176 | netif_carrier_on(dev); |
176 | 177 | if (priv->queue != -1) |
177 | - DEBUGPRINT("%s: %u Mbps %s duplex, " | |
178 | - "port %2d, queue %2d\n", | |
179 | - dev->name, link_info.s.speed, | |
180 | - (link_info.s.full_duplex) ? | |
181 | - "Full" : "Half", | |
182 | - priv->port, priv->queue); | |
178 | + printk_ratelimited("%s: %u Mbps %s duplex, " | |
179 | + "port %2d, queue %2d\n", | |
180 | + dev->name, link_info.s.speed, | |
181 | + (link_info.s.full_duplex) ? | |
182 | + "Full" : "Half", | |
183 | + priv->port, priv->queue); | |
183 | 184 | else |
184 | - DEBUGPRINT("%s: %u Mbps %s duplex, " | |
185 | - "port %2d, POW\n", | |
186 | - dev->name, link_info.s.speed, | |
187 | - (link_info.s.full_duplex) ? | |
188 | - "Full" : "Half", | |
189 | - priv->port); | |
185 | + printk_ratelimited("%s: %u Mbps %s duplex, " | |
186 | + "port %2d, POW\n", | |
187 | + dev->name, link_info.s.speed, | |
188 | + (link_info.s.full_duplex) ? | |
189 | + "Full" : "Half", | |
190 | + priv->port); | |
190 | 191 | } else { |
191 | 192 | if (netif_carrier_ok(dev)) |
192 | 193 | netif_carrier_off(dev); |
193 | - DEBUGPRINT("%s: Link down\n", dev->name); | |
194 | + printk_ratelimited("%s: Link down\n", dev->name); | |
194 | 195 | } |
195 | 196 | } |
196 | 197 | } |
drivers/staging/octeon/ethernet-rx.c
... | ... | @@ -34,6 +34,7 @@ |
34 | 34 | #include <linux/ip.h> |
35 | 35 | #include <linux/string.h> |
36 | 36 | #include <linux/prefetch.h> |
37 | +#include <linux/ratelimit.h> | |
37 | 38 | #include <linux/smp.h> |
38 | 39 | #include <net/dst.h> |
39 | 40 | #ifdef CONFIG_XFRM |
40 | 41 | |
... | ... | @@ -186,13 +187,13 @@ |
186 | 187 | |
187 | 188 | if (*ptr == 0xd5) { |
188 | 189 | /* |
189 | - DEBUGPRINT("Port %d received 0xd5 preamble\n", work->ipprt); | |
190 | + printk_ratelimited("Port %d received 0xd5 preamble\n", work->ipprt); | |
190 | 191 | */ |
191 | 192 | work->packet_ptr.s.addr += i + 1; |
192 | 193 | work->len -= i + 5; |
193 | 194 | } else if ((*ptr & 0xf) == 0xd) { |
194 | 195 | /* |
195 | - DEBUGPRINT("Port %d received 0x?d preamble\n", work->ipprt); | |
196 | + printk_ratelimited("Port %d received 0x?d preamble\n", work->ipprt); | |
196 | 197 | */ |
197 | 198 | work->packet_ptr.s.addr += i; |
198 | 199 | work->len -= i + 4; |
... | ... | @@ -203,9 +204,9 @@ |
203 | 204 | ptr++; |
204 | 205 | } |
205 | 206 | } else { |
206 | - DEBUGPRINT("Port %d unknown preamble, packet " | |
207 | - "dropped\n", | |
208 | - work->ipprt); | |
207 | + printk_ratelimited("Port %d unknown preamble, packet " | |
208 | + "dropped\n", | |
209 | + work->ipprt); | |
209 | 210 | /* |
210 | 211 | cvmx_helper_dump_packet(work); |
211 | 212 | */ |
... | ... | @@ -214,8 +215,8 @@ |
214 | 215 | } |
215 | 216 | } |
216 | 217 | } else { |
217 | - DEBUGPRINT("Port %d receive error code %d, packet dropped\n", | |
218 | - work->ipprt, work->word2.snoip.err_code); | |
218 | + printk_ratelimited("Port %d receive error code %d, packet dropped\n", | |
219 | + work->ipprt, work->word2.snoip.err_code); | |
219 | 220 | cvm_oct_free_work(work); |
220 | 221 | return 1; |
221 | 222 | } |
... | ... | @@ -334,8 +335,9 @@ |
334 | 335 | */ |
335 | 336 | skb = dev_alloc_skb(work->len); |
336 | 337 | if (!skb) { |
337 | - DEBUGPRINT("Port %d failed to allocate skbuff, packet dropped\n", | |
338 | - work->ipprt); | |
338 | + printk_ratelimited("Port %d failed to allocate " | |
339 | + "skbuff, packet dropped\n", | |
340 | + work->ipprt); | |
339 | 341 | cvm_oct_free_work(work); |
340 | 342 | continue; |
341 | 343 | } |
... | ... | @@ -429,7 +431,7 @@ |
429 | 431 | } else { |
430 | 432 | /* Drop any packet received for a device that isn't up */ |
431 | 433 | /* |
432 | - DEBUGPRINT("%s: Device not up, packet dropped\n", | |
434 | + printk_ratelimited("%s: Device not up, packet dropped\n", | |
433 | 435 | dev->name); |
434 | 436 | */ |
435 | 437 | #ifdef CONFIG_64BIT |
... | ... | @@ -444,7 +446,7 @@ |
444 | 446 | * Drop any packet received for a device that |
445 | 447 | * doesn't exist. |
446 | 448 | */ |
447 | - DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n", | |
449 | + printk_ratelimited("Port %d not controlled by Linux, packet dropped\n", | |
448 | 450 | work->ipprt); |
449 | 451 | dev_kfree_skb_irq(skb); |
450 | 452 | } |
drivers/staging/octeon/ethernet-sgmii.c
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | **********************************************************************/ |
27 | 27 | #include <linux/kernel.h> |
28 | 28 | #include <linux/netdevice.h> |
29 | +#include <linux/ratelimit.h> | |
29 | 30 | #include <net/dst.h> |
30 | 31 | |
31 | 32 | #include <asm/octeon/octeon.h> |
32 | 33 | |
33 | 34 | |
... | ... | @@ -90,20 +91,21 @@ |
90 | 91 | if (!netif_carrier_ok(dev)) |
91 | 92 | netif_carrier_on(dev); |
92 | 93 | if (priv->queue != -1) |
93 | - DEBUGPRINT | |
94 | + printk_ratelimited | |
94 | 95 | ("%s: %u Mbps %s duplex, port %2d, queue %2d\n", |
95 | 96 | dev->name, link_info.s.speed, |
96 | 97 | (link_info.s.full_duplex) ? "Full" : "Half", |
97 | 98 | priv->port, priv->queue); |
98 | 99 | else |
99 | - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", | |
100 | - dev->name, link_info.s.speed, | |
101 | - (link_info.s.full_duplex) ? "Full" : "Half", | |
102 | - priv->port); | |
100 | + printk_ratelimited | |
101 | + ("%s: %u Mbps %s duplex, port %2d, POW\n", | |
102 | + dev->name, link_info.s.speed, | |
103 | + (link_info.s.full_duplex) ? "Full" : "Half", | |
104 | + priv->port); | |
103 | 105 | } else { |
104 | 106 | if (netif_carrier_ok(dev)) |
105 | 107 | netif_carrier_off(dev); |
106 | - DEBUGPRINT("%s: Link down\n", dev->name); | |
108 | + printk_ratelimited("%s: Link down\n", dev->name); | |
107 | 109 | } |
108 | 110 | } |
109 | 111 |
drivers/staging/octeon/ethernet-tx.c
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | #include <linux/init.h> |
31 | 31 | #include <linux/etherdevice.h> |
32 | 32 | #include <linux/ip.h> |
33 | +#include <linux/ratelimit.h> | |
33 | 34 | #include <linux/string.h> |
34 | 35 | #include <net/dst.h> |
35 | 36 | #ifdef CONFIG_XFRM |
... | ... | @@ -446,7 +447,7 @@ |
446 | 447 | priv->queue + qos, |
447 | 448 | pko_command, hw_buffer, |
448 | 449 | CVMX_PKO_LOCK_NONE))) { |
449 | - DEBUGPRINT("%s: Failed to send the packet\n", dev->name); | |
450 | + printk_ratelimited("%s: Failed to send the packet\n", dev->name); | |
450 | 451 | queue_type = QUEUE_DROP; |
451 | 452 | } |
452 | 453 | skip_xmit: |
... | ... | @@ -525,8 +526,8 @@ |
525 | 526 | /* Get a work queue entry */ |
526 | 527 | cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); |
527 | 528 | if (unlikely(work == NULL)) { |
528 | - DEBUGPRINT("%s: Failed to allocate a work queue entry\n", | |
529 | - dev->name); | |
529 | + printk_ratelimited("%s: Failed to allocate a work " | |
530 | + "queue entry\n", dev->name); | |
530 | 531 | priv->stats.tx_dropped++; |
531 | 532 | dev_kfree_skb(skb); |
532 | 533 | return 0; |
... | ... | @@ -535,8 +536,8 @@ |
535 | 536 | /* Get a packet buffer */ |
536 | 537 | packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL); |
537 | 538 | if (unlikely(packet_buffer == NULL)) { |
538 | - DEBUGPRINT("%s: Failed to allocate a packet buffer\n", | |
539 | - dev->name); | |
539 | + printk_ratelimited("%s: Failed to allocate a packet buffer\n", | |
540 | + dev->name); | |
540 | 541 | cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); |
541 | 542 | priv->stats.tx_dropped++; |
542 | 543 | dev_kfree_skb(skb); |
drivers/staging/octeon/ethernet-util.h
... | ... | @@ -25,10 +25,6 @@ |
25 | 25 | * Contact Cavium Networks for more information |
26 | 26 | *********************************************************************/ |
27 | 27 | |
28 | -#define DEBUGPRINT(format, ...) do { if (printk_ratelimit()) \ | |
29 | - printk(format, ##__VA_ARGS__); \ | |
30 | - } while (0) | |
31 | - | |
32 | 28 | /** |
33 | 29 | * cvm_oct_get_buffer_ptr - convert packet data address to pointer |
34 | 30 | * @packet_ptr: Packet data hardware address |
drivers/staging/octeon/ethernet-xaui.c
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | **********************************************************************/ |
27 | 27 | #include <linux/kernel.h> |
28 | 28 | #include <linux/netdevice.h> |
29 | +#include <linux/ratelimit.h> | |
29 | 30 | #include <net/dst.h> |
30 | 31 | |
31 | 32 | #include <asm/octeon/octeon.h> |
32 | 33 | |
33 | 34 | |
... | ... | @@ -89,20 +90,21 @@ |
89 | 90 | if (!netif_carrier_ok(dev)) |
90 | 91 | netif_carrier_on(dev); |
91 | 92 | if (priv->queue != -1) |
92 | - DEBUGPRINT | |
93 | - ("%s: %u Mbps %s duplex, port %2d, queue %2d\n", | |
94 | - dev->name, link_info.s.speed, | |
95 | - (link_info.s.full_duplex) ? "Full" : "Half", | |
96 | - priv->port, priv->queue); | |
93 | + printk_ratelimited | |
94 | + ("%s: %u Mbps %s duplex, port %2d, queue %2d\n", | |
95 | + dev->name, link_info.s.speed, | |
96 | + (link_info.s.full_duplex) ? "Full" : "Half", | |
97 | + priv->port, priv->queue); | |
97 | 98 | else |
98 | - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", | |
99 | - dev->name, link_info.s.speed, | |
100 | - (link_info.s.full_duplex) ? "Full" : "Half", | |
101 | - priv->port); | |
99 | + printk_ratelimited | |
100 | + ("%s: %u Mbps %s duplex, port %2d, POW\n", | |
101 | + dev->name, link_info.s.speed, | |
102 | + (link_info.s.full_duplex) ? "Full" : "Half", | |
103 | + priv->port); | |
102 | 104 | } else { |
103 | 105 | if (netif_carrier_ok(dev)) |
104 | 106 | netif_carrier_off(dev); |
105 | - DEBUGPRINT("%s: Link down\n", dev->name); | |
107 | + printk_ratelimited("%s: Link down\n", dev->name); | |
106 | 108 | } |
107 | 109 | } |
108 | 110 |