Skip to content

Commit 9982446

Browse files
JoePerchesdavem330
authored andcommitted
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>
1 parent b747caf commit 9982446

12 files changed

Lines changed: 190 additions & 212 deletions

File tree

‎net/atm/br2684.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Eric Kinzie, 2006-2007, US Naval Research Laboratory
77
*/
88

9+
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
10+
911
#include <linux/module.h>
1012
#include <linux/init.h>
1113
#include <linux/kernel.h>
@@ -148,7 +150,7 @@ static void br2684_pop(struct atm_vcc *vcc, struct sk_buff *skb)
148150
struct br2684_vcc *brvcc = BR2684_VCC(vcc);
149151
struct net_device *net_dev = skb->dev;
150152

151-
pr_debug("br2684_pop(vcc %p ; net_dev %p )\n", vcc, net_dev);
153+
pr_debug("(vcc %p ; net_dev %p )\n", vcc, net_dev);
152154
brvcc->old_pop(vcc, skb);
153155

154156
if (!net_dev)
@@ -244,7 +246,7 @@ static netdev_tx_t br2684_start_xmit(struct sk_buff *skb,
244246
struct br2684_dev *brdev = BRPRIV(dev);
245247
struct br2684_vcc *brvcc;
246248

247-
pr_debug("br2684_start_xmit, skb_dst(skb)=%p\n", skb_dst(skb));
249+
pr_debug("skb_dst(skb)=%p\n", skb_dst(skb));
248250
read_lock(&devs_lock);
249251
brvcc = pick_outgoing_vcc(skb, brdev);
250252
if (brvcc == NULL) {
@@ -352,7 +354,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
352354
struct net_device *net_dev = brvcc->device;
353355
struct br2684_dev *brdev = BRPRIV(net_dev);
354356

355-
pr_debug("br2684_push\n");
357+
pr_debug("\n");
356358

357359
if (unlikely(skb == NULL)) {
358360
/* skb==NULL means VCC is being destroyed */
@@ -479,8 +481,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
479481
write_lock_irq(&devs_lock);
480482
net_dev = br2684_find_dev(&be.ifspec);
481483
if (net_dev == NULL) {
482-
printk(KERN_ERR
483-
"br2684: tried to attach to non-existant device\n");
484+
pr_err("tried to attach to non-existant device\n");
484485
err = -ENXIO;
485486
goto error;
486487
}
@@ -503,8 +504,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
503504
err = -EINVAL;
504505
goto error;
505506
}
506-
pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc,
507-
be.encaps, brvcc);
507+
pr_debug("vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps, brvcc);
508508
if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
509509
unsigned char *esi = atmvcc->dev->esi;
510510
if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
@@ -595,7 +595,7 @@ static int br2684_create(void __user * arg)
595595
struct atm_newif_br2684 ni;
596596
enum br2684_payload payload;
597597

598-
pr_debug("br2684_create\n");
598+
pr_debug("\n");
599599

600600
if (copy_from_user(&ni, arg, sizeof ni)) {
601601
return -EFAULT;
@@ -624,7 +624,7 @@ static int br2684_create(void __user * arg)
624624
/* open, stop, do_ioctl ? */
625625
err = register_netdev(netdev);
626626
if (err < 0) {
627-
printk(KERN_ERR "br2684_create: register_netdev failed\n");
627+
pr_err("register_netdev failed\n");
628628
free_netdev(netdev);
629629
return err;
630630
}

‎net/atm/clip.c‎

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
44

5+
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
6+
57
#include <linux/string.h>
68
#include <linux/errno.h>
79
#include <linux/kernel.h> /* for UINT_MAX */
@@ -51,7 +53,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
5153
struct atmarp_ctrl *ctrl;
5254
struct sk_buff *skb;
5355

54-
pr_debug("to_atmarpd(%d)\n", type);
56+
pr_debug("(%d)\n", type);
5557
if (!atmarpd)
5658
return -EUNATCH;
5759
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)
7173

7274
static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry)
7375
{
74-
pr_debug("link_vcc %p to entry %p (neigh %p)\n", clip_vcc, entry,
75-
entry->neigh);
76+
pr_debug("%p to entry %p (neigh %p)\n", clip_vcc, entry, entry->neigh);
7677
clip_vcc->entry = entry;
7778
clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */
7879
clip_vcc->next = entry->vccs;
@@ -86,7 +87,7 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
8687
struct clip_vcc **walk;
8788

8889
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);
9091
return;
9192
}
9293
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)
106107
error = neigh_update(entry->neigh, NULL, NUD_NONE,
107108
NEIGH_UPDATE_F_ADMIN);
108109
if (error)
109-
printk(KERN_CRIT "unlink_clip_vcc: "
110-
"neigh_update failed with %d\n", error);
110+
pr_crit("neigh_update failed with %d\n", error);
111111
goto out;
112112
}
113-
printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc "
114-
"0x%p)\n", entry, clip_vcc);
113+
pr_crit("ATMARP: failed (entry %p, vcc 0x%p)\n", entry, clip_vcc);
115114
out:
116115
netif_tx_unlock_bh(entry->neigh->dev);
117116
}
@@ -127,7 +126,7 @@ static int neigh_check_cb(struct neighbour *n)
127126

128127
if (cv->idle_timeout && time_after(jiffies, exp)) {
129128
pr_debug("releasing vcc %p->%p of entry %p\n",
130-
cv, cv->vcc, entry);
129+
cv, cv->vcc, entry);
131130
vcc_release_async(cv->vcc, -ETIMEDOUT);
132131
}
133132
}
@@ -139,7 +138,7 @@ static int neigh_check_cb(struct neighbour *n)
139138
struct sk_buff *skb;
140139

141140
pr_debug("destruction postponed with ref %d\n",
142-
atomic_read(&n->refcnt));
141+
atomic_read(&n->refcnt));
143142

144143
while ((skb = skb_dequeue(&n->arp_queue)) != NULL)
145144
dev_kfree_skb(skb);
@@ -163,7 +162,7 @@ static int clip_arp_rcv(struct sk_buff *skb)
163162
{
164163
struct atm_vcc *vcc;
165164

166-
pr_debug("clip_arp_rcv\n");
165+
pr_debug("\n");
167166
vcc = ATM_SKB(skb)->vcc;
168167
if (!vcc || !atm_charge(vcc, skb->truesize)) {
169168
dev_kfree_skb_any(skb);
@@ -188,7 +187,7 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
188187
{
189188
struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
190189

191-
pr_debug("clip push\n");
190+
pr_debug("\n");
192191
if (!skb) {
193192
pr_debug("removing VCC %p\n", clip_vcc);
194193
if (clip_vcc->entry)
@@ -239,7 +238,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
239238
int old;
240239
unsigned long flags;
241240

242-
pr_debug("clip_pop(vcc %p)\n", vcc);
241+
pr_debug("(vcc %p)\n", vcc);
243242
clip_vcc->old_pop(vcc, skb);
244243
/* skb->dev == NULL in outbound ARP packets */
245244
if (!dev)
@@ -255,7 +254,7 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
255254

256255
static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
257256
{
258-
pr_debug("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
257+
pr_debug("(neigh %p, skb %p)\n", neigh, skb);
259258
to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip);
260259
}
261260

@@ -284,7 +283,7 @@ static int clip_constructor(struct neighbour *neigh)
284283
struct in_device *in_dev;
285284
struct neigh_parms *parms;
286285

287-
pr_debug("clip_constructor (neigh %p, entry %p)\n", neigh, entry);
286+
pr_debug("(neigh %p, entry %p)\n", neigh, entry);
288287
neigh->type = inet_addr_type(&init_net, entry->ip);
289288
if (neigh->type != RTN_UNICAST)
290289
return -EINVAL;
@@ -369,9 +368,9 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
369368
int old;
370369
unsigned long flags;
371370

372-
pr_debug("clip_start_xmit (skb %p)\n", skb);
371+
pr_debug("(skb %p)\n", skb);
373372
if (!skb_dst(skb)) {
374-
printk(KERN_ERR "clip_start_xmit: skb_dst(skb) == NULL\n");
373+
pr_err("skb_dst(skb) == NULL\n");
375374
dev_kfree_skb(skb);
376375
dev->stats.tx_dropped++;
377376
return NETDEV_TX_OK;
@@ -385,7 +384,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
385384
return 0;
386385
}
387386
#endif
388-
printk(KERN_ERR "clip_start_xmit: NO NEIGHBOUR !\n");
387+
pr_err("NO NEIGHBOUR !\n");
389388
dev_kfree_skb(skb);
390389
dev->stats.tx_dropped++;
391390
return NETDEV_TX_OK;
@@ -421,7 +420,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
421420
pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev);
422421
old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */
423422
if (old) {
424-
printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n");
423+
pr_warning("XOFF->XOFF transition\n");
425424
return NETDEV_TX_OK;
426425
}
427426
dev->stats.tx_packets++;
@@ -456,7 +455,7 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
456455
clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL);
457456
if (!clip_vcc)
458457
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);
460459
clip_vcc->vcc = vcc;
461460
vcc->user_back = clip_vcc;
462461
set_bit(ATM_VF_IS_CLIP, &vcc->flags);
@@ -506,16 +505,16 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
506505
struct rtable *rt;
507506

508507
if (vcc->push != clip_push) {
509-
printk(KERN_WARNING "clip_setentry: non-CLIP VCC\n");
508+
pr_warning("non-CLIP VCC\n");
510509
return -EBADF;
511510
}
512511
clip_vcc = CLIP_VCC(vcc);
513512
if (!ip) {
514513
if (!clip_vcc->entry) {
515-
printk(KERN_ERR "hiding hidden ATMARP entry\n");
514+
pr_err("hiding hidden ATMARP entry\n");
516515
return 0;
517516
}
518-
pr_debug("setentry: remove\n");
517+
pr_debug("remove\n");
519518
unlink_clip_vcc(clip_vcc);
520519
return 0;
521520
}
@@ -529,9 +528,9 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
529528
entry = NEIGH2ENTRY(neigh);
530529
if (entry != clip_vcc->entry) {
531530
if (!clip_vcc->entry)
532-
pr_debug("setentry: add\n");
531+
pr_debug("add\n");
533532
else {
534-
pr_debug("setentry: update\n");
533+
pr_debug("update\n");
535534
unlink_clip_vcc(clip_vcc);
536535
}
537536
link_vcc(clip_vcc, entry);
@@ -614,16 +613,16 @@ static int clip_device_event(struct notifier_block *this, unsigned long event,
614613

615614
switch (event) {
616615
case NETDEV_UP:
617-
pr_debug("clip_device_event NETDEV_UP\n");
616+
pr_debug("NETDEV_UP\n");
618617
to_atmarpd(act_up, PRIV(dev)->number, 0);
619618
break;
620619
case NETDEV_GOING_DOWN:
621-
pr_debug("clip_device_event NETDEV_DOWN\n");
620+
pr_debug("NETDEV_DOWN\n");
622621
to_atmarpd(act_down, PRIV(dev)->number, 0);
623622
break;
624623
case NETDEV_CHANGE:
625624
case NETDEV_CHANGEMTU:
626-
pr_debug("clip_device_event NETDEV_CHANGE*\n");
625+
pr_debug("NETDEV_CHANGE*\n");
627626
to_atmarpd(act_change, PRIV(dev)->number, 0);
628627
break;
629628
}
@@ -660,7 +659,7 @@ static struct notifier_block clip_inet_notifier = {
660659

661660
static void atmarpd_close(struct atm_vcc *vcc)
662661
{
663-
pr_debug("atmarpd_close\n");
662+
pr_debug("\n");
664663

665664
rtnl_lock();
666665
atmarpd = NULL;
@@ -950,8 +949,7 @@ static int __init atm_clip_init(void)
950949

951950
p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
952951
if (!p) {
953-
printk(KERN_ERR "Unable to initialize "
954-
"/proc/net/atm/arp\n");
952+
pr_err("Unable to initialize /proc/net/atm/arp\n");
955953
atm_clip_exit_noproc();
956954
return -ENOMEM;
957955
}

0 commit comments

Comments
 (0)