diff options
| author | Joe Perches <joe@perches.com> | 2012-03-11 14:36:11 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-03-12 02:42:51 -0400 |
| commit | 058bd4d2a4ff0aaa4a5381c67e776729d840c785 (patch) | |
| tree | 4d1ea864a8740676c7e7c5a03cdaa67fc5f29418 | |
| parent | 43db362d3adda9e0a915ddb9a8d1a41186e19179 (diff) | |
net: Convert printks to pr_<level>
Use a more current kernel messaging style.
Convert a printk block to print_hex_dump.
Coalesce formats, align arguments.
Use %s, __func__ instead of embedding function names.
Some messages that were prefixed with <foo>_close are
now prefixed with <foo>_fini. Some ah4 and esp messages
are now not prefixed with "ip ".
The intent of this patch is to later add something like
#define pr_fmt(fmt) "IPv4: " fmt.
to standardize the output messages.
Text size is trivially reduced. (x86-32 allyesconfig)
$ size net/ipv4/built-in.o*
text data bss dec hex filename
887888 31558 249696 1169142 11d6f6 net/ipv4/built-in.o.new
887934 31558 249800 1169292 11d78c net/ipv4/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/ipv4/af_inet.c | 25 | ||||
| -rw-r--r-- | net/ipv4/ah4.c | 14 | ||||
| -rw-r--r-- | net/ipv4/esp4.c | 8 | ||||
| -rw-r--r-- | net/ipv4/fib_frontend.c | 6 | ||||
| -rw-r--r-- | net/ipv4/fib_semantics.c | 2 | ||||
| -rw-r--r-- | net/ipv4/fib_trie.c | 5 | ||||
| -rw-r--r-- | net/ipv4/icmp.c | 19 | ||||
| -rw-r--r-- | net/ipv4/ip_fragment.c | 3 | ||||
| -rw-r--r-- | net/ipv4/ip_gre.c | 6 | ||||
| -rw-r--r-- | net/ipv4/ip_input.c | 4 | ||||
| -rw-r--r-- | net/ipv4/ip_options.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipcomp.c | 8 | ||||
| -rw-r--r-- | net/ipv4/ipconfig.c | 110 | ||||
| -rw-r--r-- | net/ipv4/ipip.c | 4 | ||||
| -rw-r--r-- | net/ipv4/ipmr.c | 4 | ||||
| -rw-r--r-- | net/ipv4/ping.c | 18 | ||||
| -rw-r--r-- | net/ipv4/raw.c | 7 | ||||
| -rw-r--r-- | net/ipv4/route.c | 43 | ||||
| -rw-r--r-- | net/ipv4/tcp.c | 7 | ||||
| -rw-r--r-- | net/ipv4/tcp_cong.c | 7 | ||||
| -rw-r--r-- | net/ipv4/tcp_input.c | 8 | ||||
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 8 | ||||
| -rw-r--r-- | net/ipv4/tunnel4.c | 8 | ||||
| -rw-r--r-- | net/ipv4/udplite.c | 4 | ||||
| -rw-r--r-- | net/ipv4/xfrm4_tunnel.c | 14 |
25 files changed, 163 insertions, 181 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index e588a34e85c2..b7a946611f2f 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -1085,13 +1085,11 @@ out: | |||
| 1085 | return; | 1085 | return; |
| 1086 | 1086 | ||
| 1087 | out_permanent: | 1087 | out_permanent: |
| 1088 | printk(KERN_ERR "Attempt to override permanent protocol %d.\n", | 1088 | pr_err("Attempt to override permanent protocol %d\n", protocol); |
| 1089 | protocol); | ||
| 1090 | goto out; | 1089 | goto out; |
| 1091 | 1090 | ||
| 1092 | out_illegal: | 1091 | out_illegal: |
| 1093 | printk(KERN_ERR | 1092 | pr_err("Ignoring attempt to register invalid socket type %d\n", |
| 1094 | "Ignoring attempt to register invalid socket type %d.\n", | ||
| 1095 | p->type); | 1093 | p->type); |
| 1096 | goto out; | 1094 | goto out; |
| 1097 | } | 1095 | } |
| @@ -1100,8 +1098,7 @@ EXPORT_SYMBOL(inet_register_protosw); | |||
| 1100 | void inet_unregister_protosw(struct inet_protosw *p) | 1098 | void inet_unregister_protosw(struct inet_protosw *p) |
| 1101 | { | 1099 | { |
| 1102 | if (INET_PROTOSW_PERMANENT & p->flags) { | 1100 | if (INET_PROTOSW_PERMANENT & p->flags) { |
| 1103 | printk(KERN_ERR | 1101 | pr_err("Attempt to unregister permanent protocol %d\n", |
| 1104 | "Attempt to unregister permanent protocol %d.\n", | ||
| 1105 | p->protocol); | 1102 | p->protocol); |
| 1106 | } else { | 1103 | } else { |
| 1107 | spin_lock_bh(&inetsw_lock); | 1104 | spin_lock_bh(&inetsw_lock); |
| @@ -1150,8 +1147,8 @@ static int inet_sk_reselect_saddr(struct sock *sk) | |||
| 1150 | return 0; | 1147 | return 0; |
| 1151 | 1148 | ||
| 1152 | if (sysctl_ip_dynaddr > 1) { | 1149 | if (sysctl_ip_dynaddr > 1) { |
| 1153 | printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", | 1150 | pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n", |
| 1154 | __func__, &old_saddr, &new_saddr); | 1151 | __func__, &old_saddr, &new_saddr); |
| 1155 | } | 1152 | } |
| 1156 | 1153 | ||
| 1157 | inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; | 1154 | inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; |
| @@ -1680,14 +1677,14 @@ static int __init inet_init(void) | |||
| 1680 | */ | 1677 | */ |
| 1681 | 1678 | ||
| 1682 | if (inet_add_protocol(&icmp_protocol, IPPROTO_ICMP) < 0) | 1679 | if (inet_add_protocol(&icmp_protocol, IPPROTO_ICMP) < 0) |
| 1683 | printk(KERN_CRIT "inet_init: Cannot add ICMP protocol\n"); | 1680 | pr_crit("%s: Cannot add ICMP protocol\n", __func__); |
| 1684 | if (inet_add_protocol(&udp_protocol, IPPROTO_UDP) < 0) | 1681 | if (inet_add_protocol(&udp_protocol, IPPROTO_UDP) < 0) |
| 1685 | printk(KERN_CRIT "inet_init: Cannot add UDP protocol\n"); | 1682 | pr_crit("%s: Cannot add UDP protocol\n", __func__); |
| 1686 | if (inet_add_protocol(&tcp_protocol, IPPROTO_TCP) < 0) | 1683 | if (inet_add_protocol(&tcp_protocol, IPPROTO_TCP) < 0) |
| 1687 | printk(KERN_CRIT "inet_init: Cannot add TCP protocol\n"); | 1684 | pr_crit("%s: Cannot add TCP protocol\n", __func__); |
| 1688 | #ifdef CONFIG_IP_MULTICAST | 1685 | #ifdef CONFIG_IP_MULTICAST |
| 1689 | if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0) | 1686 | if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0) |
| 1690 | printk(KERN_CRIT "inet_init: Cannot add IGMP protocol\n"); | 1687 | pr_crit("%s: Cannot add IGMP protocol\n", __func__); |
| 1691 | #endif | 1688 | #endif |
| 1692 | 1689 | ||
| 1693 | /* Register the socket-side information for inet_create. */ | 1690 | /* Register the socket-side information for inet_create. */ |
| @@ -1734,14 +1731,14 @@ static int __init inet_init(void) | |||
| 1734 | */ | 1731 | */ |
| 1735 | #if defined(CONFIG_IP_MROUTE) | 1732 | #if defined(CONFIG_IP_MROUTE) |
| 1736 | if (ip_mr_init()) | 1733 | if (ip_mr_init()) |
| 1737 | printk(KERN_CRIT "inet_init: Cannot init ipv4 mroute\n"); | 1734 | pr_crit("%s: Cannot init ipv4 mroute\n", __func__); |
| 1738 | #endif | 1735 | #endif |
| 1739 | /* | 1736 | /* |
| 1740 | * Initialise per-cpu ipv4 mibs | 1737 | * Initialise per-cpu ipv4 mibs |
| 1741 | */ | 1738 | */ |
| 1742 | 1739 | ||
| 1743 | if (init_ipv4_mibs()) | 1740 | if (init_ipv4_mibs()) |
| 1744 | printk(KERN_CRIT "inet_init: Cannot init ipv4 mibs\n"); | 1741 | pr_crit("%s: Cannot init ipv4 mibs\n", __func__); |
| 1745 | 1742 | ||
| 1746 | ipv4_proc_init(); | 1743 | ipv4_proc_init(); |
| 1747 | 1744 | ||
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 36d14406261e..b5524660c81d 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
| @@ -445,9 +445,9 @@ static int ah_init_state(struct xfrm_state *x) | |||
| 445 | 445 | ||
| 446 | if (aalg_desc->uinfo.auth.icv_fullbits/8 != | 446 | if (aalg_desc->uinfo.auth.icv_fullbits/8 != |
| 447 | crypto_ahash_digestsize(ahash)) { | 447 | crypto_ahash_digestsize(ahash)) { |
| 448 | printk(KERN_INFO "AH: %s digestsize %u != %hu\n", | 448 | pr_info("AH: %s digestsize %u != %hu\n", |
| 449 | x->aalg->alg_name, crypto_ahash_digestsize(ahash), | 449 | x->aalg->alg_name, crypto_ahash_digestsize(ahash), |
| 450 | aalg_desc->uinfo.auth.icv_fullbits/8); | 450 | aalg_desc->uinfo.auth.icv_fullbits/8); |
| 451 | goto error; | 451 | goto error; |
| 452 | } | 452 | } |
| 453 | 453 | ||
| @@ -510,11 +510,11 @@ static const struct net_protocol ah4_protocol = { | |||
| 510 | static int __init ah4_init(void) | 510 | static int __init ah4_init(void) |
| 511 | { | 511 | { |
| 512 | if (xfrm_register_type(&ah_type, AF_INET) < 0) { | 512 | if (xfrm_register_type(&ah_type, AF_INET) < 0) { |
| 513 | printk(KERN_INFO "ip ah init: can't add xfrm type\n"); | 513 | pr_info("%s: can't add xfrm type\n", __func__); |
| 514 | return -EAGAIN; | 514 | return -EAGAIN; |
| 515 | } | 515 | } |
| 516 | if (inet_add_protocol(&ah4_protocol, IPPROTO_AH) < 0) { | 516 | if (inet_add_protocol(&ah4_protocol, IPPROTO_AH) < 0) { |
| 517 | printk(KERN_INFO "ip ah init: can't add protocol\n"); | 517 | pr_info("%s: can't add protocol\n", __func__); |
| 518 | xfrm_unregister_type(&ah_type, AF_INET); | 518 | xfrm_unregister_type(&ah_type, AF_INET); |
| 519 | return -EAGAIN; | 519 | return -EAGAIN; |
| 520 | } | 520 | } |
| @@ -524,9 +524,9 @@ static int __init ah4_init(void) | |||
| 524 | static void __exit ah4_fini(void) | 524 | static void __exit ah4_fini(void) |
| 525 | { | 525 | { |
| 526 | if (inet_del_protocol(&ah4_protocol, IPPROTO_AH) < 0) | 526 | if (inet_del_protocol(&ah4_protocol, IPPROTO_AH) < 0) |
| 527 | printk(KERN_INFO "ip ah close: can't remove protocol\n"); | 527 | pr_info("%s: can't remove protocol\n", __func__); |
| 528 | if (xfrm_unregister_type(&ah_type, AF_INET) < 0) | 528 | if (xfrm_unregister_type(&ah_type, AF_INET) < 0) |
| 529 | printk(KERN_INFO "ip ah close: can't remove xfrm type\n"); | 529 | pr_info("%s: can't remove xfrm type\n", __func__); |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | module_init(ah4_init); | 532 | module_init(ah4_init); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index a5b413416da3..0a86dbe9454b 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
| @@ -706,11 +706,11 @@ static const struct net_protocol esp4_protocol = { | |||
| 706 | static int __init esp4_init(void) | 706 | static int __init esp4_init(void) |
| 707 | { | 707 | { |
| 708 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { | 708 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { |
| 709 | printk(KERN_INFO "ip esp init: can't add xfrm type\n"); | 709 | pr_info("%s: can't add xfrm type\n", __func__); |
| 710 | return -EAGAIN; | 710 | return -EAGAIN; |
| 711 | } | 711 | } |
| 712 | if (inet_add_protocol(&esp4_protocol, IPPROTO_ESP) < 0) { | 712 | if (inet_add_protocol(&esp4_protocol, IPPROTO_ESP) < 0) { |
