diff options
author | Joe Perches <joe@perches.com> | 2010-01-26 06:40:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-27 00:15:56 -0500 |
commit | 99824461ea72ca0044cc6508f02c0e1cabf37ba5 (patch) | |
tree | 8672e525869778c9d4c12fe3982306387995bf2a /net/atm/clip.c | |
parent | b747caf365b4121903b26d1cd65454c7bc607184 (diff) |
net/atm: Convert printk to pr_<level>
Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
Remove function names from output
Use single line pr_debug instead of broken multiple uses without newline
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/clip.c')
-rw-r--r-- | net/atm/clip.c | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c index 64629c354343..d7939fd58cd3 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -2,6 +2,8 @@ | |||
2 | 2 | ||
3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ |
4 | 4 | ||
5 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ | ||
6 | |||
5 | #include <linux/string.h> | 7 | #include <linux/string.h> |
6 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
7 | #include <linux/kernel.h> /* for UINT_MAX */ | 9 | #include <linux/kernel.h> /* for UINT_MAX */ |
@@ -51,7 +53,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip) | |||
51 | struct atmarp_ctrl *ctrl; | 53 | struct atmarp_ctrl *ctrl; |
52 | struct sk_buff *skb; | 54 | struct sk_buff *skb; |
53 | 55 | ||
54 | pr_debug("to_atmarpd(%d)\n", type); | 56 | pr_debug("(%d)\n", type); |
55 | if (!atmarpd) | 57 | if (!atmarpd) |
56 | return -EUNATCH; | 58 | return -EUNATCH; |
57 | skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC); | 59 | skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC); |
@@ -71,8 +73,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip) | |||
71 | 73 | ||
72 | static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry) | 74 | static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry) |
73 | { | 75 | { |
74 | pr_debug("link_vcc %p to entry %p (neigh %p)\n", clip_vcc, entry, | 76 | pr_debug("%p to entry %p (neigh %p)\n", clip_vcc, entry, entry->neigh); |
75 | entry->neigh); | ||
76 | clip_vcc->entry = entry; | 77 | clip_vcc->entry = entry; |
77 | clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */ | 78 | clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */ |
78 | clip_vcc->next = entry->vccs; | 79 | clip_vcc->next = entry->vccs; |
@@ -86,7 +87,7 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc) | |||
86 | struct clip_vcc **walk; | 87 | struct clip_vcc **walk; |
87 | 88 | ||
88 | if (!entry) { | 89 | if (!entry) { |
89 | printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n", clip_vcc); | 90 | pr_crit("!clip_vcc->entry (clip_vcc %p)\n", clip_vcc); |
90 | return; | 91 | return; |
91 | } | 92 | } |
92 | netif_tx_lock_bh(entry->neigh->dev); /* block clip_start_xmit() */ | 93 | netif_tx_lock_bh(entry->neigh->dev); /* block clip_start_xmit() */ |
@@ -106,12 +107,10 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc) | |||
106 | error = neigh_update(entry->neigh, NULL, NUD_NONE, | 107 | error = neigh_update(entry->neigh, NULL, NUD_NONE, |
107 | NEIGH_UPDATE_F_ADMIN); | 108 | NEIGH_UPDATE_F_ADMIN); |
108 | if (error) | 109 | if (error) |
109 | printk(KERN_CRIT "unlink_clip_vcc: " | 110 | pr_crit("neigh_update failed with %d\n", error); |
110 | "neigh_update failed with %d\n", error); | ||
111 | goto out; | 111 | goto out; |
112 | } | 112 | } |
113 | printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " | 113 | pr_crit("ATMARP: failed (entry %p, vcc 0x%p)\n", entry, clip_vcc); |
114 | "0x%p)\n", entry, clip_vcc); | ||
115 | out: | 114 | out: |
116 | netif_tx_unlock_bh(entry->neigh->dev); | 115 | netif_tx_unlock_bh(entry->neigh->dev); |
117 | } | 116 | } |
@@ -127,7 +126,7 @@ static int neigh_check_cb(struct neighbour *n) | |||
127 | 126 | ||
128 | if (cv->idle_timeout && time_after(jiffies, exp)) { | 127 | if (cv->idle_timeout && time_after(jiffies, exp)) { |
129 | pr_debug("releasing vcc %p->%p of entry %p\n", | 128 | pr_debug("releasing vcc %p->%p of entry %p\n", |
130 | cv, cv->vcc, entry); | 129 | cv, cv->vcc, entry); |
131 | vcc_release_async(cv->vcc, -ETIMEDOUT); | 130 | vcc_release_async(cv->vcc, -ETIMEDOUT); |
132 | } | 131 | } |
133 | } | 132 | } |
@@ -139,7 +138,7 @@ static int neigh_check_cb(struct neighbour *n) | |||
139 | struct sk_buff *skb; | 138 | struct sk_buff *skb; |
140 | 139 | ||
141 | pr_debug("destruction postponed with ref %d\n", | 140 | pr_debug("destruction postponed with ref %d\n", |
142 | atomic_read(&n->refcnt)); | 141 | atomic_read(&n->refcnt)); |
143 | 142 | ||
144 | while ((skb = skb_dequeue(&n->arp_queue)) != NULL) | 143 | while ((skb = skb_dequeue(&n->arp_queue)) != NULL) |
145 | dev_kfree_skb(skb); | 144 | dev_kfree_skb(skb); |
@@ -163,7 +162,7 @@ static int clip_arp_rcv(struct sk_buff *skb) | |||
163 | { | 162 | { |
164 | struct atm_vcc *vcc; | 163 | struct atm_vcc *vcc; |
165 | 164 | ||
166 | pr_debug("clip_arp_rcv\n"); | 165 | pr_debug("\n"); |
167 | vcc = ATM_SKB(skb)->vcc; | 166 | vcc = ATM_SKB(skb)->vcc; |
168 | if (!vcc || !atm_charge(vcc, skb->truesize)) { | 167 | if (!vcc || !atm_charge(vcc, skb->truesize)) { |
169 | dev_kfree_skb_any(skb); | 168 | dev_kfree_skb_any(skb); |
@@ -188,7 +187,7 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb) | |||
188 | { | 187 | { |
189 | struct clip_vcc *clip_vcc = CLIP_VCC(vcc); | 188 | struct clip_vcc *clip_vcc = CLIP_VCC(vcc); |
190 | 189 | ||
191 | pr_debug("clip push\n"); | 190 | pr_debug("\n"); |
192 | if (!skb) { | 191 | if (!skb) { |
193 | pr_debug("removing VCC %p\n", clip_vcc); | 192 | pr_debug("removing VCC %p\n", clip_vcc); |
194 | if (clip_vcc->entry) | 193 | if (clip_vcc->entry) |
@@ -239,7 +238,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb) | |||
239 | int old; | 238 | int old; |
240 | unsigned long flags; | 239 | unsigned long flags; |
241 | 240 | ||
242 | pr_debug("clip_pop(vcc %p)\n", vcc); | 241 | pr_debug("(vcc %p)\n", vcc); |
243 | clip_vcc->old_pop(vcc, skb); | 242 | clip_vcc->old_pop(vcc, skb); |
244 | /* skb->dev == NULL in outbound ARP packets */ | 243 | /* skb->dev == NULL in outbound ARP packets */ |
245 | if (!dev) | 244 | if (!dev) |
@@ -255,7 +254,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb) | |||
255 | 254 | ||
256 | static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) | 255 | static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) |
257 | { | 256 | { |
258 | pr_debug("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb); | 257 | pr_debug("(neigh %p, skb %p)\n", neigh, skb); |
259 | to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip); | 258 | to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip); |
260 | } | 259 | } |
261 | 260 | ||
@@ -284,7 +283,7 @@ static int clip_constructor(struct neighbour *neigh) | |||
284 | struct in_device *in_dev; | 283 | struct in_device *in_dev; |
285 | struct neigh_parms *parms; | 284 | struct neigh_parms *parms; |
286 | 285 | ||
287 | pr_debug("clip_constructor (neigh %p, entry %p)\n", neigh, entry); | 286 | pr_debug("(neigh %p, entry %p)\n", neigh, entry); |
288 | neigh->type = inet_addr_type(&init_net, entry->ip); | 287 | neigh->type = inet_addr_type(&init_net, entry->ip); |
289 | if (neigh->type != RTN_UNICAST) | 288 | if (neigh->type != RTN_UNICAST) |
290 | return -EINVAL; | 289 | return -EINVAL; |
@@ -369,9 +368,9 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb, | |||
369 | int old; | 368 | int old; |
370 | unsigned long flags; | 369 | unsigned long flags; |
371 | 370 | ||
372 | pr_debug("clip_start_xmit (skb %p)\n", skb); | 371 | pr_debug("(skb %p)\n", skb); |
373 | if (!skb_dst(skb)) { | 372 | if (!skb_dst(skb)) { |
374 | printk(KERN_ERR "clip_start_xmit: skb_dst(skb) == NULL\n"); | 373 | pr_err("skb_dst(skb) == NULL\n"); |
375 | dev_kfree_skb(skb); | 374 | dev_kfree_skb(skb); |
376 | dev->stats.tx_dropped++; | 375 | dev->stats.tx_dropped++; |
377 | return NETDEV_TX_OK; | 376 | return NETDEV_TX_OK; |
@@ -385,7 +384,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb, | |||
385 | return 0; | 384 | return 0; |
386 | } | 385 | } |
387 | #endif | 386 | #endif |
388 | printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n"); | 387 | pr_err("NO NEIGHBOUR !\n"); |
389 | dev_kfree_skb(skb); | 388 | dev_kfree_skb(skb); |
390 | dev->stats.tx_dropped++; | 389 | dev->stats.tx_dropped++; |
391 | return NETDEV_TX_OK; | 390 | return NETDEV_TX_OK; |
@@ -421,7 +420,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb, | |||
421 | pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev); | 420 | pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev); |
422 | old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */ | 421 | old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */ |
423 | if (old) { | 422 | if (old) { |
424 | printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); | 423 | pr_warning("XOFF->XOFF transition\n"); |
425 | return NETDEV_TX_OK; | 424 | return NETDEV_TX_OK; |
426 | } | 425 | } |
427 | dev->stats.tx_packets++; | 426 | dev->stats.tx_packets++; |
@@ -456,7 +455,7 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout) | |||
456 | clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL); | 455 | clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL); |
457 | if (!clip_vcc) | 456 | if (!clip_vcc) |
458 | return -ENOMEM; | 457 | return -ENOMEM; |
459 | pr_debug("mkip clip_vcc %p vcc %p\n", clip_vcc, vcc); | 458 | pr_debug("%p vcc %p\n", clip_vcc, vcc); |
460 | clip_vcc->vcc = vcc; | 459 | clip_vcc->vcc = vcc; |
461 | vcc->user_back = clip_vcc; | 460 | vcc->user_back = clip_vcc; |
462 | set_bit(ATM_VF_IS_CLIP, &vcc->flags); | 461 | set_bit(ATM_VF_IS_CLIP, &vcc->flags); |
@@ -506,16 +505,16 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip) | |||
506 | struct rtable *rt; | 505 | struct rtable *rt; |
507 | 506 | ||
508 | if (vcc->push != clip_push) { | 507 | if (vcc->push != clip_push) { |
509 | printk(KERN_WARNING "clip_setentry: non-CLIP VCC\n"); | 508 | pr_warning("non-CLIP VCC\n"); |
510 | return -EBADF; | 509 | return -EBADF; |
511 | } | 510 | } |
512 | clip_vcc = CLIP_VCC(vcc); | 511 | clip_vcc = CLIP_VCC(vcc); |
513 | if (!ip) { | 512 | if (!ip) { |
514 | if (!clip_vcc->entry) { | 513 | if (!clip_vcc->entry) { |
515 | printk(KERN_ERR "hiding hidden ATMARP entry\n"); | 514 | pr_err("hiding hidden ATMARP entry\n"); |
516 | return 0; | 515 | return 0; |
517 | } | 516 | } |
518 | pr_debug("setentry: remove\n"); | 517 | pr_debug("remove\n"); |
519 | unlink_clip_vcc(clip_vcc); | 518 | unlink_clip_vcc(clip_vcc); |
520 | return 0; | 519 | return 0; |
521 | } | 520 | } |
@@ -529,9 +528,9 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip) | |||
529 | entry = NEIGH2ENTRY(neigh); | 528 | entry = NEIGH2ENTRY(neigh); |
530 | if (entry != clip_vcc->entry) { | 529 | if (entry != clip_vcc->entry) { |
531 | if (!clip_vcc->entry) | 530 | if (!clip_vcc->entry) |
532 | pr_debug("setentry: add\n"); | 531 | pr_debug("add\n"); |
533 | else { | 532 | else { |
534 | pr_debug("setentry: update\n"); | 533 | pr_debug("update\n"); |
535 | unlink_clip_vcc(clip_vcc); | 534 | unlink_clip_vcc(clip_vcc); |
536 | } | 535 | } |
537 | link_vcc(clip_vcc, entry); | 536 | link_vcc(clip_vcc, entry); |
@@ -614,16 +613,16 @@ static int clip_device_event(struct notifier_block *this, unsigned long event, | |||
614 | 613 | ||
615 | switch (event) { | 614 | switch (event) { |
616 | case NETDEV_UP: | 615 | case NETDEV_UP: |
617 | pr_debug("clip_device_event NETDEV_UP\n"); | 616 | pr_debug("NETDEV_UP\n"); |
618 | to_atmarpd(act_up, PRIV(dev)->number, 0); | 617 | to_atmarpd(act_up, PRIV(dev)->number, 0); |
619 | break; | 618 | break; |
620 | case NETDEV_GOING_DOWN: | 619 | case NETDEV_GOING_DOWN: |
621 | pr_debug("clip_device_event NETDEV_DOWN\n"); | 620 | pr_debug("NETDEV_DOWN\n"); |
622 | to_atmarpd(act_down, PRIV(dev)->number, 0); | 621 | to_atmarpd(act_down, PRIV(dev)->number, 0); |
623 | break; | 622 | break; |
624 | case NETDEV_CHANGE: | 623 | case NETDEV_CHANGE: |
625 | case NETDEV_CHANGEMTU: | 624 | case NETDEV_CHANGEMTU: |
626 | pr_debug("clip_device_event NETDEV_CHANGE*\n"); | 625 | pr_debug("NETDEV_CHANGE*\n"); |
627 | to_atmarpd(act_change, PRIV(dev)->number, 0); | 626 | to_atmarpd(act_change, PRIV(dev)->number, 0); |
628 | break; | 627 | break; |
629 | } | 628 | } |
@@ -660,7 +659,7 @@ static struct notifier_block clip_inet_notifier = { | |||
660 | 659 | ||
661 | static void atmarpd_close(struct atm_vcc *vcc) | 660 | static void atmarpd_close(struct atm_vcc *vcc) |
662 | { | 661 | { |
663 | pr_debug("atmarpd_close\n"); | 662 | pr_debug("\n"); |
664 | 663 | ||
665 | rtnl_lock(); | 664 | rtnl_lock(); |
666 | atmarpd = NULL; | 665 | atmarpd = NULL; |
@@ -950,8 +949,7 @@ static int __init atm_clip_init(void) | |||
950 | 949 | ||
951 | p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); | 950 | p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); |
952 | if (!p) { | 951 | if (!p) { |
953 | printk(KERN_ERR "Unable to initialize " | 952 | pr_err("Unable to initialize /proc/net/atm/arp\n"); |
954 | "/proc/net/atm/arp\n"); | ||
955 | atm_clip_exit_noproc(); | 953 | atm_clip_exit_noproc(); |
956 | return -ENOMEM; | 954 | return -ENOMEM; |
957 | } | 955 | } |