diff options
author | Joe Perches <joe@perches.com> | 2012-05-15 10:11:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-16 01:01:03 -0400 |
commit | 91df42bedccb919902c7cf7eb876c982ae7f1b1d (patch) | |
tree | a941627c25c941b8f26d20d2c214ff2004eae356 /net/ipv4 | |
parent | f32138319ca6541e65f95f8e17c9cc88ac1baf94 (diff) |
net: ipv4 and ipv6: Convert printk(KERN_DEBUG to pr_debug
Use the current debugging style and enable dynamic_debug.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ah4.c | 4 | ||||
-rw-r--r-- | net/ipv4/arp.c | 9 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 5 | ||||
-rw-r--r-- | net/ipv4/inet_timewait_sock.c | 4 | ||||
-rw-r--r-- | net/ipv4/route.c | 9 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 48 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 4 |
7 files changed, 42 insertions, 41 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 3a280756dd73..e8f2617ecd47 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -406,8 +406,8 @@ static void ah4_err(struct sk_buff *skb, u32 info) | |||
406 | ah->spi, IPPROTO_AH, AF_INET); | 406 | ah->spi, IPPROTO_AH, AF_INET); |
407 | if (!x) | 407 | if (!x) |
408 | return; | 408 | return; |
409 | printk(KERN_DEBUG "pmtu discovery on SA AH/%08x/%08x\n", | 409 | pr_debug("pmtu discovery on SA AH/%08x/%08x\n", |
410 | ntohl(ah->spi), ntohl(iph->daddr)); | 410 | ntohl(ah->spi), ntohl(iph->daddr)); |
411 | xfrm_state_put(x); | 411 | xfrm_state_put(x); |
412 | } | 412 | } |
413 | 413 | ||
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 373b56bf8f49..3e2bf3dedce5 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -73,6 +73,8 @@ | |||
73 | * Jesper D. Brouer: Proxy ARP PVLAN RFC 3069 support. | 73 | * Jesper D. Brouer: Proxy ARP PVLAN RFC 3069 support. |
74 | */ | 74 | */ |
75 | 75 | ||
76 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
77 | |||
76 | #include <linux/module.h> | 78 | #include <linux/module.h> |
77 | #include <linux/types.h> | 79 | #include <linux/types.h> |
78 | #include <linux/string.h> | 80 | #include <linux/string.h> |
@@ -364,8 +366,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
364 | probes -= neigh->parms->ucast_probes; | 366 | probes -= neigh->parms->ucast_probes; |
365 | if (probes < 0) { | 367 | if (probes < 0) { |
366 | if (!(neigh->nud_state & NUD_VALID)) | 368 | if (!(neigh->nud_state & NUD_VALID)) |
367 | printk(KERN_DEBUG | 369 | pr_debug("trying to ucast probe in NUD_INVALID\n"); |
368 | "trying to ucast probe in NUD_INVALID\n"); | ||
369 | dst_ha = neigh->ha; | 370 | dst_ha = neigh->ha; |
370 | read_lock_bh(&neigh->lock); | 371 | read_lock_bh(&neigh->lock); |
371 | } else { | 372 | } else { |
@@ -452,7 +453,7 @@ static int arp_set_predefined(int addr_hint, unsigned char *haddr, | |||
452 | { | 453 | { |
453 | switch (addr_hint) { | 454 | switch (addr_hint) { |
454 | case RTN_LOCAL: | 455 | case RTN_LOCAL: |
455 | printk(KERN_DEBUG "ARP: arp called for own IP address\n"); | 456 | pr_debug("arp called for own IP address\n"); |
456 | memcpy(haddr, dev->dev_addr, dev->addr_len); | 457 | memcpy(haddr, dev->dev_addr, dev->addr_len); |
457 | return 1; | 458 | return 1; |
458 | case RTN_MULTICAST: | 459 | case RTN_MULTICAST: |
@@ -473,7 +474,7 @@ int arp_find(unsigned char *haddr, struct sk_buff *skb) | |||
473 | struct neighbour *n; | 474 | struct neighbour *n; |
474 | 475 | ||
475 | if (!skb_dst(skb)) { | 476 | if (!skb_dst(skb)) { |
476 | printk(KERN_DEBUG "arp_find is called with dst==NULL\n"); | 477 | pr_debug("arp_find is called with dst==NULL\n"); |
477 | kfree_skb(skb); | 478 | kfree_skb(skb); |
478 | return 1; | 479 | return 1; |
479 | } | 480 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 88c9e3f68c78..10e15a144e95 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -217,8 +217,7 @@ void in_dev_finish_destroy(struct in_device *idev) | |||
217 | WARN_ON(idev->ifa_list); | 217 | WARN_ON(idev->ifa_list); |
218 | WARN_ON(idev->mc_list); | 218 | WARN_ON(idev->mc_list); |
219 | #ifdef NET_REFCNT_DEBUG | 219 | #ifdef NET_REFCNT_DEBUG |
220 | printk(KERN_DEBUG "in_dev_finish_destroy: %p=%s\n", | 220 | pr_debug("%s: %p=%s\n", __func__, idev, dev ? dev->name : "NIL"); |
221 | idev, dev ? dev->name : "NIL"); | ||
222 | #endif | 221 | #endif |
223 | dev_put(dev); | 222 | dev_put(dev); |
224 | if (!idev->dead) | 223 | if (!idev->dead) |
@@ -1174,7 +1173,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1174 | 1173 | ||
1175 | switch (event) { | 1174 | switch (event) { |
1176 | case NETDEV_REGISTER: | 1175 | case NETDEV_REGISTER: |
1177 | printk(KERN_DEBUG "inetdev_event: bug\n"); | 1176 | pr_debug("%s: bug\n", __func__); |
1178 | RCU_INIT_POINTER(dev->ip_ptr, NULL); | 1177 | RCU_INIT_POINTER(dev->ip_ptr, NULL); |
1179 | break; | 1178 | break; |
1180 | case NETDEV_UP: | 1179 | case NETDEV_UP: |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 543ef6225458..2784db3155fb 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -89,8 +89,8 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw, | |||
89 | 89 | ||
90 | #ifdef SOCK_REFCNT_DEBUG | 90 | #ifdef SOCK_REFCNT_DEBUG |
91 | if (atomic_read(&tw->tw_refcnt) != 1) { | 91 | if (atomic_read(&tw->tw_refcnt) != 1) { |
92 | printk(KERN_DEBUG "%s timewait_sock %p refcnt=%d\n", | 92 | pr_debug("%s timewait_sock %p refcnt=%d\n", |
93 | tw->tw_prot->name, tw, atomic_read(&tw->tw_refcnt)); | 93 | tw->tw_prot->name, tw, atomic_read(&tw->tw_refcnt)); |
94 | } | 94 | } |
95 | #endif | 95 | #endif |
96 | while (refcnt) { | 96 | while (refcnt) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 42d76441501f..76e5880cdb07 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1374,8 +1374,7 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more) | |||
1374 | return; | 1374 | return; |
1375 | } | 1375 | } |
1376 | } else if (!rt) | 1376 | } else if (!rt) |
1377 | printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", | 1377 | pr_debug("rt_bind_peer(0) @%p\n", __builtin_return_address(0)); |
1378 | __builtin_return_address(0)); | ||
1379 | 1378 | ||
1380 | ip_select_fb_ident(iph); | 1379 | ip_select_fb_ident(iph); |
1381 | } | 1380 | } |
@@ -1839,9 +1838,9 @@ static void ipv4_link_failure(struct sk_buff *skb) | |||
1839 | 1838 | ||
1840 | static int ip_rt_bug(struct sk_buff *skb) | 1839 | static int ip_rt_bug(struct sk_buff *skb) |
1841 | { | 1840 | { |
1842 | printk(KERN_DEBUG "ip_rt_bug: %pI4 -> %pI4, %s\n", | 1841 | pr_debug("%s: %pI4 -> %pI4, %s\n", |
1843 | &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, | 1842 | __func__, &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, |
1844 | skb->dev ? skb->dev->name : "?"); | 1843 | skb->dev ? skb->dev->name : "?"); |
1845 | kfree_skb(skb); | 1844 | kfree_skb(skb); |
1846 | WARN_ON(1); | 1845 | WARN_ON(1); |
1847 | return 0; | 1846 | return 0; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 100b242135b1..eb97787be757 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -981,12 +981,12 @@ static void tcp_update_reordering(struct sock *sk, const int metric, | |||
981 | 981 | ||
982 | NET_INC_STATS_BH(sock_net(sk), mib_idx); | 982 | NET_INC_STATS_BH(sock_net(sk), mib_idx); |
983 | #if FASTRETRANS_DEBUG > 1 | 983 | #if FASTRETRANS_DEBUG > 1 |
984 | printk(KERN_DEBUG "Disorder%d %d %u f%u s%u rr%d\n", | 984 | pr_debug("Disorder%d %d %u f%u s%u rr%d\n", |
985 | tp->rx_opt.sack_ok, inet_csk(sk)->icsk_ca_state, | 985 | tp->rx_opt.sack_ok, inet_csk(sk)->icsk_ca_state, |
986 | tp->reordering, | 986 | tp->reordering, |
987 | tp->fackets_out, | 987 | tp->fackets_out, |
988 | tp->sacked_out, | 988 | tp->sacked_out, |
989 | tp->undo_marker ? tp->undo_retrans : 0); | 989 | tp->undo_marker ? tp->undo_retrans : 0); |
990 | #endif | 990 | #endif |
991 | tcp_disable_fack(tp); | 991 | tcp_disable_fack(tp); |
992 | } | 992 | } |
@@ -2716,22 +2716,22 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2716 | struct inet_sock *inet = inet_sk(sk); | 2716 | struct inet_sock *inet = inet_sk(sk); |
2717 | 2717 | ||
2718 | if (sk->sk_family == AF_INET) { | 2718 | if (sk->sk_family == AF_INET) { |
2719 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", | 2719 | pr_debug("Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", |
2720 | msg, | 2720 | msg, |
2721 | &inet->inet_daddr, ntohs(inet->inet_dport), | 2721 | &inet->inet_daddr, ntohs(inet->inet_dport), |
2722 | tp->snd_cwnd, tcp_left_out(tp), | 2722 | tp->snd_cwnd, tcp_left_out(tp), |
2723 | tp->snd_ssthresh, tp->prior_ssthresh, | 2723 | tp->snd_ssthresh, tp->prior_ssthresh, |
2724 | tp->packets_out); | 2724 | tp->packets_out); |
2725 | } | 2725 | } |
2726 | #if IS_ENABLED(CONFIG_IPV6) | 2726 | #if IS_ENABLED(CONFIG_IPV6) |
2727 | else if (sk->sk_family == AF_INET6) { | 2727 | else if (sk->sk_family == AF_INET6) { |
2728 | struct ipv6_pinfo *np = inet6_sk(sk); | 2728 | struct ipv6_pinfo *np = inet6_sk(sk); |
2729 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", | 2729 | pr_debug("Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", |
2730 | msg, | 2730 | msg, |
2731 | &np->daddr, ntohs(inet->inet_dport), | 2731 | &np->daddr, ntohs(inet->inet_dport), |
2732 | tp->snd_cwnd, tcp_left_out(tp), | 2732 | tp->snd_cwnd, tcp_left_out(tp), |
2733 | tp->snd_ssthresh, tp->prior_ssthresh, | 2733 | tp->snd_ssthresh, tp->prior_ssthresh, |
2734 | tp->packets_out); | 2734 | tp->packets_out); |
2735 | } | 2735 | } |
2736 | #endif | 2736 | #endif |
2737 | } | 2737 | } |
@@ -3511,18 +3511,18 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, | |||
3511 | if (!tp->packets_out && tcp_is_sack(tp)) { | 3511 | if (!tp->packets_out && tcp_is_sack(tp)) { |
3512 | icsk = inet_csk(sk); | 3512 | icsk = inet_csk(sk); |
3513 | if (tp->lost_out) { | 3513 | if (tp->lost_out) { |
3514 | printk(KERN_DEBUG "Leak l=%u %d\n", | 3514 | pr_debug("Leak l=%u %d\n", |
3515 | tp->lost_out, icsk->icsk_ca_state); | 3515 | tp->lost_out, icsk->icsk_ca_state); |
3516 | tp->lost_out = 0; | 3516 | tp->lost_out = 0; |
3517 | } | 3517 | } |
3518 | if (tp->sacked_out) { | 3518 | if (tp->sacked_out) { |
3519 | printk(KERN_DEBUG "Leak s=%u %d\n", | 3519 | pr_debug("Leak s=%u %d\n", |
3520 | tp->sacked_out, icsk->icsk_ca_state); | 3520 | tp->sacked_out, icsk->icsk_ca_state); |
3521 | tp->sacked_out = 0; | 3521 | tp->sacked_out = 0; |
3522 | } | 3522 | } |
3523 | if (tp->retrans_out) { | 3523 | if (tp->retrans_out) { |
3524 | printk(KERN_DEBUG "Leak r=%u %d\n", | 3524 | pr_debug("Leak r=%u %d\n", |
3525 | tp->retrans_out, icsk->icsk_ca_state); | 3525 | tp->retrans_out, icsk->icsk_ca_state); |
3526 | tp->retrans_out = 0; | 3526 | tp->retrans_out = 0; |
3527 | } | 3527 | } |
3528 | } | 3528 | } |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7979bfd5d0fb..1a630825c45b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -34,6 +34,8 @@ | |||
34 | * | 34 | * |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #define pr_fmt(fmt) "TCP: " fmt | ||
38 | |||
37 | #include <net/tcp.h> | 39 | #include <net/tcp.h> |
38 | 40 | ||
39 | #include <linux/compiler.h> | 41 | #include <linux/compiler.h> |
@@ -2415,7 +2417,7 @@ int tcp_send_synack(struct sock *sk) | |||
2415 | 2417 | ||
2416 | skb = tcp_write_queue_head(sk); | 2418 | skb = tcp_write_queue_head(sk); |
2417 | if (skb == NULL || !(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) { | 2419 | if (skb == NULL || !(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) { |
2418 | printk(KERN_DEBUG "tcp_send_synack: wrong queue state\n"); | 2420 | pr_debug("%s: wrong queue state\n", __func__); |
2419 | return -EFAULT; | 2421 | return -EFAULT; |
2420 | } | 2422 | } |
2421 | if (!(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK)) { | 2423 | if (!(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK)) { |