aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/common.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-26 06:40:00 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-27 00:15:56 -0500
commit99824461ea72ca0044cc6508f02c0e1cabf37ba5 (patch)
tree8672e525869778c9d4c12fe3982306387995bf2a /net/atm/common.c
parentb747caf365b4121903b26d1cd65454c7bc607184 (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/common.c')
-rw-r--r--net/atm/common.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index d61e051e0a3f..17f7e5f2131b 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -2,6 +2,7 @@
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__
5 6
6#include <linux/module.h> 7#include <linux/module.h>
7#include <linux/kmod.h> 8#include <linux/kmod.h>
@@ -64,8 +65,7 @@ static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size)
64 65
65 if (sk_wmem_alloc_get(sk) && !atm_may_send(vcc, size)) { 66 if (sk_wmem_alloc_get(sk) && !atm_may_send(vcc, size)) {
66 pr_debug("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n", 67 pr_debug("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n",
67 sk_wmem_alloc_get(sk), size, 68 sk_wmem_alloc_get(sk), size, sk->sk_sndbuf);
68 sk->sk_sndbuf);
69 return NULL; 69 return NULL;
70 } 70 }
71 while (!(skb = alloc_skb(size, GFP_KERNEL))) 71 while (!(skb = alloc_skb(size, GFP_KERNEL)))
@@ -249,8 +249,7 @@ static int adjust_tp(struct atm_trafprm *tp,unsigned char aal)
249 max_sdu = ATM_MAX_AAL34_PDU; 249 max_sdu = ATM_MAX_AAL34_PDU;
250 break; 250 break;
251 default: 251 default:
252 printk(KERN_WARNING "ATM: AAL problems ... " 252 pr_warning("AAL problems ... (%d)\n", aal);
253 "(%d)\n",aal);
254 /* fall through */ 253 /* fall through */
255 case ATM_AAL5: 254 case ATM_AAL5:
256 max_sdu = ATM_MAX_AAL5_PDU; 255 max_sdu = ATM_MAX_AAL5_PDU;
@@ -385,11 +384,17 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi,
385 if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); 384 if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal);
386 if (error) 385 if (error)
387 goto fail; 386 goto fail;
388 pr_debug("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); 387 pr_debug("VCC %d.%d, AAL %d\n", vpi, vci, vcc->qos.aal);
389 pr_debug(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, 388 pr_debug(" TX: %d, PCR %d..%d, SDU %d\n",
390 vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); 389 vcc->qos.txtp.traffic_class,
391 pr_debug(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, 390 vcc->qos.txtp.min_pcr,
392 vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); 391 vcc->qos.txtp.max_pcr,
392 vcc->qos.txtp.max_sdu);
393 pr_debug(" RX: %d, PCR %d..%d, SDU %d\n",
394 vcc->qos.rxtp.traffic_class,
395 vcc->qos.rxtp.min_pcr,
396 vcc->qos.rxtp.max_pcr,
397 vcc->qos.rxtp.max_sdu);
393 398
394 if (dev->ops->open) { 399 if (dev->ops->open) {
395 if ((error = dev->ops->open(vcc))) 400 if ((error = dev->ops->open(vcc)))
@@ -413,7 +418,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
413 struct atm_vcc *vcc = ATM_SD(sock); 418 struct atm_vcc *vcc = ATM_SD(sock);
414 int error; 419 int error;
415 420
416 pr_debug("vcc_connect (vpi %d, vci %d)\n",vpi,vci); 421 pr_debug("(vpi %d, vci %d)\n", vpi, vci);
417 if (sock->state == SS_CONNECTED) 422 if (sock->state == SS_CONNECTED)
418 return -EISCONN; 423 return -EISCONN;
419 if (sock->state != SS_UNCONNECTED) 424 if (sock->state != SS_UNCONNECTED)
@@ -426,14 +431,15 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
426 else 431 else
427 if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) 432 if (test_bit(ATM_VF_PARTIAL,&vcc->flags))
428 return -EINVAL; 433 return -EINVAL;
429 pr_debug("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; " 434 pr_debug("(TX: cl %d,bw %d-%d,sdu %d; "
430 "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n", 435 "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n",
431 vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr, 436 vcc->qos.txtp.traffic_class, vcc->qos.txtp.min_pcr,
432 vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu, 437 vcc->qos.txtp.max_pcr, vcc->qos.txtp.max_sdu,
433 vcc->qos.rxtp.traffic_class,vcc->qos.rxtp.min_pcr, 438 vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,
434 vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu, 439 vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu,
435 vcc->qos.aal == ATM_AAL5 ? "" : vcc->qos.aal == ATM_AAL0 ? "" : 440 vcc->qos.aal == ATM_AAL5 ? "" :
436 " ??? code ",vcc->qos.aal == ATM_AAL0 ? 0 : vcc->qos.aal); 441 vcc->qos.aal == ATM_AAL0 ? "" : " ??? code ",
442 vcc->qos.aal == ATM_AAL0 ? 0 : vcc->qos.aal);
437 if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) 443 if (!test_bit(ATM_VF_HASQOS, &vcc->flags))
438 return -EBADFD; 444 return -EBADFD;
439 if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || 445 if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
@@ -497,7 +503,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
497 if (error) 503 if (error)
498 return error; 504 return error;
499 sock_recv_ts_and_drops(msg, sk, skb); 505 sock_recv_ts_and_drops(msg, sk, skb);
500 pr_debug("RcvM %d -= %d\n", atomic_read(&sk->sk_rmem_alloc), skb->truesize); 506 pr_debug("%d -= %d\n", atomic_read(&sk->sk_rmem_alloc), skb->truesize);
501 atm_return(vcc, skb->truesize); 507 atm_return(vcc, skb->truesize);
502 skb_free_datagram(sk, skb); 508 skb_free_datagram(sk, skb);
503 return copied; 509 return copied;
@@ -772,19 +778,19 @@ static int __init atm_init(void)
772 goto out; 778 goto out;
773 779
774 if ((error = atmpvc_init()) < 0) { 780 if ((error = atmpvc_init()) < 0) {
775 printk(KERN_ERR "atmpvc_init() failed with %d\n", error); 781 pr_err("atmpvc_init() failed with %d\n", error);
776 goto out_unregister_vcc_proto; 782 goto out_unregister_vcc_proto;
777 } 783 }
778 if ((error = atmsvc_init()) < 0) { 784 if ((error = atmsvc_init()) < 0) {
779 printk(KERN_ERR "atmsvc_init() failed with %d\n", error); 785 pr_err("atmsvc_init() failed with %d\n", error);
780 goto out_atmpvc_exit; 786 goto out_atmpvc_exit;
781 } 787 }
782 if ((error = atm_proc_init()) < 0) { 788 if ((error = atm_proc_init()) < 0) {
783 printk(KERN_ERR "atm_proc_init() failed with %d\n",error); 789 pr_err("atm_proc_init() failed with %d\n", error);
784 goto out_atmsvc_exit; 790 goto out_atmsvc_exit;
785 } 791 }
786 if ((error = atm_sysfs_init()) < 0) { 792 if ((error = atm_sysfs_init()) < 0) {
787 printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error); 793 pr_err("atm_sysfs_init() failed with %d\n", error);
788 goto out_atmproc_exit; 794 goto out_atmproc_exit;
789 } 795 }
790out: 796out: