diff options
author | Joe Perches <joe@perches.com> | 2012-05-13 17:56:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-15 13:45:03 -0400 |
commit | e87cc4728f0e2fb663e592a1141742b1d6c63256 (patch) | |
tree | b8219696d37f0c8d0521d5853560b97fc96dc667 /net/decnet | |
parent | 3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (diff) |
net: Convert net_ratelimit uses to net_<level>_ratelimited
Standardize the net core ratelimited logging functions.
Coalesce formats, align arguments.
Change a printk then vprintk sequence to use printf extension %pV.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_fib.c | 5 | ||||
-rw-r--r-- | net/decnet/dn_neigh.c | 22 | ||||
-rw-r--r-- | net/decnet/dn_nsp_in.c | 11 | ||||
-rw-r--r-- | net/decnet/dn_nsp_out.c | 5 | ||||
-rw-r--r-- | net/decnet/dn_route.c | 15 | ||||
-rw-r--r-- | net/decnet/dn_table.c | 4 | ||||
-rw-r--r-- | net/decnet/netfilter/dn_rtmsg.c | 3 |
7 files changed, 27 insertions, 38 deletions
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index 65a8cd7891fe..7eaf98799729 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
@@ -438,9 +438,8 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn | |||
438 | res->fi = NULL; | 438 | res->fi = NULL; |
439 | return 1; | 439 | return 1; |
440 | default: | 440 | default: |
441 | if (net_ratelimit()) | 441 | net_err_ratelimited("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n", |
442 | printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n", | 442 | type); |
443 | type); | ||
444 | res->fi = NULL; | 443 | res->fi = NULL; |
445 | return -EINVAL; | 444 | return -EINVAL; |
446 | } | 445 | } |
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c index ee7013f24fca..ac90f658586c 100644 --- a/net/decnet/dn_neigh.c +++ b/net/decnet/dn_neigh.c | |||
@@ -162,8 +162,8 @@ static int dn_neigh_construct(struct neighbour *neigh) | |||
162 | else if ((dev->type == ARPHRD_ETHER) || (dev->type == ARPHRD_LOOPBACK)) | 162 | else if ((dev->type == ARPHRD_ETHER) || (dev->type == ARPHRD_LOOPBACK)) |
163 | dn_dn2eth(neigh->ha, dn->addr); | 163 | dn_dn2eth(neigh->ha, dn->addr); |
164 | else { | 164 | else { |
165 | if (net_ratelimit()) | 165 | net_dbg_ratelimited("Trying to create neigh for hw %d\n", |
166 | printk(KERN_DEBUG "Trying to create neigh for hw %d\n", dev->type); | 166 | dev->type); |
167 | return -EINVAL; | 167 | return -EINVAL; |
168 | } | 168 | } |
169 | 169 | ||
@@ -236,15 +236,13 @@ static int dn_long_output(struct neighbour *neigh, struct sk_buff *skb) | |||
236 | if (skb_headroom(skb) < headroom) { | 236 | if (skb_headroom(skb) < headroom) { |
237 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); | 237 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); |
238 | if (skb2 == NULL) { | 238 | if (skb2 == NULL) { |
239 | if (net_ratelimit()) | 239 | net_crit_ratelimited("dn_long_output: no memory\n"); |
240 | printk(KERN_CRIT "dn_long_output: no memory\n"); | ||
241 | kfree_skb(skb); | 240 | kfree_skb(skb); |
242 | return -ENOBUFS; | 241 | return -ENOBUFS; |
243 | } | 242 | } |
244 | kfree_skb(skb); | 243 | kfree_skb(skb); |
245 | skb = skb2; | 244 | skb = skb2; |
246 | if (net_ratelimit()) | 245 | net_info_ratelimited("dn_long_output: Increasing headroom\n"); |
247 | printk(KERN_INFO "dn_long_output: Increasing headroom\n"); | ||
248 | } | 246 | } |
249 | 247 | ||
250 | data = skb_push(skb, sizeof(struct dn_long_packet) + 3); | 248 | data = skb_push(skb, sizeof(struct dn_long_packet) + 3); |
@@ -281,15 +279,13 @@ static int dn_short_output(struct neighbour *neigh, struct sk_buff *skb) | |||
281 | if (skb_headroom(skb) < headroom) { | 279 | if (skb_headroom(skb) < headroom) { |
282 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); | 280 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); |
283 | if (skb2 == NULL) { | 281 | if (skb2 == NULL) { |
284 | if (net_ratelimit()) | 282 | net_crit_ratelimited("dn_short_output: no memory\n"); |
285 | printk(KERN_CRIT "dn_short_output: no memory\n"); | ||
286 | kfree_skb(skb); | 283 | kfree_skb(skb); |
287 | return -ENOBUFS; | 284 | return -ENOBUFS; |
288 | } | 285 | } |
289 | kfree_skb(skb); | 286 | kfree_skb(skb); |
290 | skb = skb2; | 287 | skb = skb2; |
291 | if (net_ratelimit()) | 288 | net_info_ratelimited("dn_short_output: Increasing headroom\n"); |
292 | printk(KERN_INFO "dn_short_output: Increasing headroom\n"); | ||
293 | } | 289 | } |
294 | 290 | ||
295 | data = skb_push(skb, sizeof(struct dn_short_packet) + 2); | 291 | data = skb_push(skb, sizeof(struct dn_short_packet) + 2); |
@@ -322,15 +318,13 @@ static int dn_phase3_output(struct neighbour *neigh, struct sk_buff *skb) | |||
322 | if (skb_headroom(skb) < headroom) { | 318 | if (skb_headroom(skb) < headroom) { |
323 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); | 319 | struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); |
324 | if (skb2 == NULL) { | 320 | if (skb2 == NULL) { |
325 | if (net_ratelimit()) | 321 | net_crit_ratelimited("dn_phase3_output: no memory\n"); |
326 | printk(KERN_CRIT "dn_phase3_output: no memory\n"); | ||
327 | kfree_skb(skb); | 322 | kfree_skb(skb); |
328 | return -ENOBUFS; | 323 | return -ENOBUFS; |
329 | } | 324 | } |
330 | kfree_skb(skb); | 325 | kfree_skb(skb); |
331 | skb = skb2; | 326 | skb = skb2; |
332 | if (net_ratelimit()) | 327 | net_info_ratelimited("dn_phase3_output: Increasing headroom\n"); |
333 | printk(KERN_INFO "dn_phase3_output: Increasing headroom\n"); | ||
334 | } | 328 | } |
335 | 329 | ||
336 | data = skb_push(skb, sizeof(struct dn_short_packet) + 2); | 330 | data = skb_push(skb, sizeof(struct dn_short_packet) + 2); |
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 58084f37151e..c344163e6ac0 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -80,12 +80,15 @@ extern int decnet_log_martians; | |||
80 | 80 | ||
81 | static void dn_log_martian(struct sk_buff *skb, const char *msg) | 81 | static void dn_log_martian(struct sk_buff *skb, const char *msg) |
82 | { | 82 | { |
83 | if (decnet_log_martians && net_ratelimit()) { | 83 | if (decnet_log_martians) { |
84 | char *devname = skb->dev ? skb->dev->name : "???"; | 84 | char *devname = skb->dev ? skb->dev->name : "???"; |
85 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 85 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
86 | printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", | 86 | net_info_ratelimited("DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", |
87 | msg, devname, le16_to_cpu(cb->src), le16_to_cpu(cb->dst), | 87 | msg, devname, |
88 | le16_to_cpu(cb->src_port), le16_to_cpu(cb->dst_port)); | 88 | le16_to_cpu(cb->src), |
89 | le16_to_cpu(cb->dst), | ||
90 | le16_to_cpu(cb->src_port), | ||
91 | le16_to_cpu(cb->dst_port)); | ||
89 | } | 92 | } |
90 | } | 93 | } |
91 | 94 | ||
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c index b952f88d9c1f..564a6ad13ce7 100644 --- a/net/decnet/dn_nsp_out.c +++ b/net/decnet/dn_nsp_out.c | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | * DECnet An implementation of the DECnet protocol suite for the LINUX | 2 | * DECnet An implementation of the DECnet protocol suite for the LINUX |
4 | * operating system. DECnet is implemented using the BSD Socket | 3 | * operating system. DECnet is implemented using the BSD Socket |
@@ -554,8 +553,8 @@ static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg, | |||
554 | unsigned char *msg; | 553 | unsigned char *msg; |
555 | 554 | ||
556 | if ((dst == NULL) || (rem == 0)) { | 555 | if ((dst == NULL) || (rem == 0)) { |
557 | if (net_ratelimit()) | 556 | net_dbg_ratelimited("DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n", |
558 | printk(KERN_DEBUG "DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n", le16_to_cpu(rem), dst); | 557 | le16_to_cpu(rem), dst); |
559 | return; | 558 | return; |
560 | } | 559 | } |
561 | 560 | ||
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 7e1f8788da19..586302e557ad 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -748,8 +748,7 @@ static int dn_output(struct sk_buff *skb) | |||
748 | dn_to_neigh_output); | 748 | dn_to_neigh_output); |
749 | 749 | ||
750 | error: | 750 | error: |
751 | if (net_ratelimit()) | 751 | net_dbg_ratelimited("dn_output: This should not happen\n"); |
752 | printk(KERN_DEBUG "dn_output: This should not happen\n"); | ||
753 | 752 | ||
754 | kfree_skb(skb); | 753 | kfree_skb(skb); |
755 | 754 | ||
@@ -807,12 +806,10 @@ drop: | |||
807 | */ | 806 | */ |
808 | static int dn_rt_bug(struct sk_buff *skb) | 807 | static int dn_rt_bug(struct sk_buff *skb) |
809 | { | 808 | { |
810 | if (net_ratelimit()) { | 809 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
811 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | ||
812 | 810 | ||
813 | printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n", | 811 | net_dbg_ratelimited("dn_rt_bug: skb from:%04x to:%04x\n", |
814 | le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); | 812 | le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); |
815 | } | ||
816 | 813 | ||
817 | kfree_skb(skb); | 814 | kfree_skb(skb); |
818 | 815 | ||
@@ -1327,9 +1324,7 @@ static int dn_route_input_slow(struct sk_buff *skb) | |||
1327 | 1324 | ||
1328 | out_dev = DN_FIB_RES_DEV(res); | 1325 | out_dev = DN_FIB_RES_DEV(res); |
1329 | if (out_dev == NULL) { | 1326 | if (out_dev == NULL) { |
1330 | if (net_ratelimit()) | 1327 | net_crit_ratelimited("Bug in dn_route_input_slow() No output device\n"); |
1331 | printk(KERN_CRIT "Bug in dn_route_input_slow() " | ||
1332 | "No output device\n"); | ||
1333 | goto e_inval; | 1328 | goto e_inval; |
1334 | } | 1329 | } |
1335 | dev_hold(out_dev); | 1330 | dev_hold(out_dev); |
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index a9a62f225a6b..650f3380c98a 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -836,8 +836,8 @@ struct dn_fib_table *dn_fib_get_table(u32 n, int create) | |||
836 | if (!create) | 836 | if (!create) |
837 | return NULL; | 837 | return NULL; |
838 | 838 | ||
839 | if (in_interrupt() && net_ratelimit()) { | 839 | if (in_interrupt()) { |
840 | printk(KERN_DEBUG "DECnet: BUG! Attempt to create routing table from interrupt\n"); | 840 | net_dbg_ratelimited("DECnet: BUG! Attempt to create routing table from interrupt\n"); |
841 | return NULL; | 841 | return NULL; |
842 | } | 842 | } |
843 | 843 | ||
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index 1531135130db..44b890936fc0 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c | |||
@@ -57,8 +57,7 @@ nlmsg_failure: | |||
57 | if (skb) | 57 | if (skb) |
58 | kfree_skb(skb); | 58 | kfree_skb(skb); |
59 | *errp = -ENOMEM; | 59 | *errp = -ENOMEM; |
60 | if (net_ratelimit()) | 60 | net_err_ratelimited("dn_rtmsg: error creating netlink message\n"); |
61 | printk(KERN_ERR "dn_rtmsg: error creating netlink message\n"); | ||
62 | return NULL; | 61 | return NULL; |
63 | } | 62 | } |
64 | 63 | ||