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
7274static 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
256255static 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
661660static 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