Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
David S. Miller
058bd4d2 43db362d

+163 -181
+11 -14
net/ipv4/af_inet.c
··· 1085 1085 return; 1086 1086 1087 1087 out_permanent: 1088 - printk(KERN_ERR "Attempt to override permanent protocol %d.\n", 1089 - protocol); 1088 + pr_err("Attempt to override permanent protocol %d\n", protocol); 1090 1089 goto out; 1091 1090 1092 1091 out_illegal: 1093 - printk(KERN_ERR 1094 - "Ignoring attempt to register invalid socket type %d.\n", 1092 + pr_err("Ignoring attempt to register invalid socket type %d\n", 1095 1093 p->type); 1096 1094 goto out; 1097 1095 } ··· 1098 1100 void inet_unregister_protosw(struct inet_protosw *p) 1099 1101 { 1100 1102 if (INET_PROTOSW_PERMANENT & p->flags) { 1101 - printk(KERN_ERR 1102 - "Attempt to unregister permanent protocol %d.\n", 1103 + pr_err("Attempt to unregister permanent protocol %d\n", 1103 1104 p->protocol); 1104 1105 } else { 1105 1106 spin_lock_bh(&inetsw_lock); ··· 1147 1150 return 0; 1148 1151 1149 1152 if (sysctl_ip_dynaddr > 1) { 1150 - printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", 1151 - __func__, &old_saddr, &new_saddr); 1153 + pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n", 1154 + __func__, &old_saddr, &new_saddr); 1152 1155 } 1153 1156 1154 1157 inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; ··· 1677 1680 */ 1678 1681 1679 1682 if (inet_add_protocol(&icmp_protocol, IPPROTO_ICMP) < 0) 1680 - printk(KERN_CRIT "inet_init: Cannot add ICMP protocol\n"); 1683 + pr_crit("%s: Cannot add ICMP protocol\n", __func__); 1681 1684 if (inet_add_protocol(&udp_protocol, IPPROTO_UDP) < 0) 1682 - printk(KERN_CRIT "inet_init: Cannot add UDP protocol\n"); 1685 + pr_crit("%s: Cannot add UDP protocol\n", __func__); 1683 1686 if (inet_add_protocol(&tcp_protocol, IPPROTO_TCP) < 0) 1684 - printk(KERN_CRIT "inet_init: Cannot add TCP protocol\n"); 1687 + pr_crit("%s: Cannot add TCP protocol\n", __func__); 1685 1688 #ifdef CONFIG_IP_MULTICAST 1686 1689 if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0) 1687 - printk(KERN_CRIT "inet_init: Cannot add IGMP protocol\n"); 1690 + pr_crit("%s: Cannot add IGMP protocol\n", __func__); 1688 1691 #endif 1689 1692 1690 1693 /* Register the socket-side information for inet_create. */ ··· 1731 1734 */ 1732 1735 #if defined(CONFIG_IP_MROUTE) 1733 1736 if (ip_mr_init()) 1734 - printk(KERN_CRIT "inet_init: Cannot init ipv4 mroute\n"); 1737 + pr_crit("%s: Cannot init ipv4 mroute\n", __func__); 1735 1738 #endif 1736 1739 /* 1737 1740 * Initialise per-cpu ipv4 mibs 1738 1741 */ 1739 1742 1740 1743 if (init_ipv4_mibs()) 1741 - printk(KERN_CRIT "inet_init: Cannot init ipv4 mibs\n"); 1744 + pr_crit("%s: Cannot init ipv4 mibs\n", __func__); 1742 1745 1743 1746 ipv4_proc_init(); 1744 1747
+7 -7
net/ipv4/ah4.c
··· 445 445 446 446 if (aalg_desc->uinfo.auth.icv_fullbits/8 != 447 447 crypto_ahash_digestsize(ahash)) { 448 - printk(KERN_INFO "AH: %s digestsize %u != %hu\n", 449 - x->aalg->alg_name, crypto_ahash_digestsize(ahash), 450 - aalg_desc->uinfo.auth.icv_fullbits/8); 448 + pr_info("AH: %s digestsize %u != %hu\n", 449 + x->aalg->alg_name, crypto_ahash_digestsize(ahash), 450 + aalg_desc->uinfo.auth.icv_fullbits/8); 451 451 goto error; 452 452 } 453 453 ··· 510 510 static int __init ah4_init(void) 511 511 { 512 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 514 return -EAGAIN; 515 515 } 516 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 518 xfrm_unregister_type(&ah_type, AF_INET); 519 519 return -EAGAIN; 520 520 } ··· 524 524 static void __exit ah4_fini(void) 525 525 { 526 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 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 532 module_init(ah4_init);
+4 -4
net/ipv4/esp4.c
··· 706 706 static int __init esp4_init(void) 707 707 { 708 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 710 return -EAGAIN; 711 711 } 712 712 if (inet_add_protocol(&esp4_protocol, IPPROTO_ESP) < 0) { 713 - printk(KERN_INFO "ip esp init: can't add protocol\n"); 713 + pr_info("%s: can't add protocol\n", __func__); 714 714 xfrm_unregister_type(&esp_type, AF_INET); 715 715 return -EAGAIN; 716 716 } ··· 720 720 static void __exit esp4_fini(void) 721 721 { 722 722 if (inet_del_protocol(&esp4_protocol, IPPROTO_ESP) < 0) 723 - printk(KERN_INFO "ip esp close: can't remove protocol\n"); 723 + pr_info("%s: can't remove protocol\n", __func__); 724 724 if (xfrm_unregister_type(&esp_type, AF_INET) < 0) 725 - printk(KERN_INFO "ip esp close: can't remove xfrm type\n"); 725 + pr_info("%s: can't remove xfrm type\n", __func__); 726 726 } 727 727 728 728 module_init(esp4_init);
+3 -3
net/ipv4/fib_frontend.c
··· 695 695 if (ifa->ifa_flags & IFA_F_SECONDARY) { 696 696 prim = inet_ifa_byprefix(in_dev, prefix, mask); 697 697 if (prim == NULL) { 698 - printk(KERN_WARNING "fib_add_ifaddr: bug: prim == NULL\n"); 698 + pr_warn("%s: bug: prim == NULL\n", __func__); 699 699 return; 700 700 } 701 701 } ··· 749 749 if (ifa->ifa_flags & IFA_F_SECONDARY) { 750 750 prim = inet_ifa_byprefix(in_dev, any, ifa->ifa_mask); 751 751 if (prim == NULL) { 752 - printk(KERN_WARNING "fib_del_ifaddr: bug: prim == NULL\n"); 752 + pr_warn("%s: bug: prim == NULL\n", __func__); 753 753 return; 754 754 } 755 755 if (iprim && iprim != prim) { 756 - printk(KERN_WARNING "fib_del_ifaddr: bug: iprim != prim\n"); 756 + pr_warn("%s: bug: iprim != prim\n", __func__); 757 757 return; 758 758 } 759 759 } else if (!ipv4_is_zeronet(any) &&
+1 -1
net/ipv4/fib_semantics.c
··· 154 154 void free_fib_info(struct fib_info *fi) 155 155 { 156 156 if (fi->fib_dead == 0) { 157 - pr_warning("Freeing alive fib_info %p\n", fi); 157 + pr_warn("Freeing alive fib_info %p\n", fi); 158 158 return; 159 159 } 160 160 change_nexthops(fi) {
+2 -3
net/ipv4/fib_trie.c
··· 1170 1170 } 1171 1171 1172 1172 if (tp && tp->pos + tp->bits > 32) 1173 - pr_warning("fib_trie" 1174 - " tp=%p pos=%d, bits=%d, key=%0x plen=%d\n", 1175 - tp, tp->pos, tp->bits, key, plen); 1173 + pr_warn("fib_trie tp=%p pos=%d, bits=%d, key=%0x plen=%d\n", 1174 + tp, tp->pos, tp->bits, key, plen); 1176 1175 1177 1176 /* Rebalance the trie */ 1178 1177
+8 -11
net/ipv4/icmp.c
··· 670 670 break; 671 671 case ICMP_FRAG_NEEDED: 672 672 if (ipv4_config.no_pmtu_disc) { 673 - LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n", 673 + LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set\n", 674 674 &iph->daddr); 675 675 } else { 676 676 info = ip_rt_frag_needed(net, iph, ··· 681 681 } 682 682 break; 683 683 case ICMP_SR_FAILED: 684 - LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed.\n", 684 + LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed\n", 685 685 &iph->daddr); 686 686 break; 687 687 default: ··· 713 713 if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && 714 714 inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { 715 715 if (net_ratelimit()) 716 - printk(KERN_WARNING "%pI4 sent an invalid ICMP " 717 - "type %u, code %u " 718 - "error to a broadcast: %pI4 on %s\n", 719 - &ip_hdr(skb)->saddr, 720 - icmph->type, icmph->code, 721 - &iph->daddr, 722 - skb->dev->name); 716 + pr_warn("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n", 717 + &ip_hdr(skb)->saddr, 718 + icmph->type, icmph->code, 719 + &iph->daddr, skb->dev->name); 723 720 goto out; 724 721 } 725 722 ··· 943 946 break; 944 947 } 945 948 if (!ifa && net_ratelimit()) { 946 - printk(KERN_INFO "Wrong address mask %pI4 from %s/%pI4\n", 947 - mp, dev->name, &ip_hdr(skb)->saddr); 949 + pr_info("Wrong address mask %pI4 from %s/%pI4\n", 950 + mp, dev->name, &ip_hdr(skb)->saddr); 948 951 } 949 952 } 950 953 }
+1 -2
net/ipv4/ip_fragment.c
··· 643 643 goto out_fail; 644 644 out_oversize: 645 645 if (net_ratelimit()) 646 - printk(KERN_INFO "Oversized IP packet from %pI4.\n", 647 - &qp->saddr); 646 + pr_info("Oversized IP packet from %pI4\n", &qp->saddr); 648 647 out_fail: 649 648 IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); 650 649 return err;
+3 -3
net/ipv4/ip_gre.c
··· 1716 1716 { 1717 1717 int err; 1718 1718 1719 - printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); 1719 + pr_info("GRE over IPv4 tunneling driver\n"); 1720 1720 1721 1721 err = register_pernet_device(&ipgre_net_ops); 1722 1722 if (err < 0) ··· 1724 1724 1725 1725 err = gre_add_protocol(&ipgre_protocol, GREPROTO_CISCO); 1726 1726 if (err < 0) { 1727 - printk(KERN_INFO "ipgre init: can't add protocol\n"); 1727 + pr_info("%s: can't add protocol\n", __func__); 1728 1728 goto add_proto_failed; 1729 1729 } 1730 1730 ··· 1753 1753 rtnl_link_unregister(&ipgre_tap_ops); 1754 1754 rtnl_link_unregister(&ipgre_link_ops); 1755 1755 if (gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO) < 0) 1756 - printk(KERN_INFO "ipgre close: can't remove protocol\n"); 1756 + pr_info("%s: can't remove protocol\n", __func__); 1757 1757 unregister_pernet_device(&ipgre_net_ops); 1758 1758 } 1759 1759
+2 -2
net/ipv4/ip_input.c
··· 299 299 if (!IN_DEV_SOURCE_ROUTE(in_dev)) { 300 300 if (IN_DEV_LOG_MARTIANS(in_dev) && 301 301 net_ratelimit()) 302 - printk(KERN_INFO "source route option %pI4 -> %pI4\n", 303 - &iph->saddr, &iph->daddr); 302 + pr_info("source route option %pI4 -> %pI4\n", 303 + &iph->saddr, &iph->daddr); 304 304 goto drop; 305 305 } 306 306 }
+1 -1
net/ipv4/ip_options.c
··· 577 577 ip_rt_get_source(&optptr[srrptr-1], skb, rt); 578 578 optptr[2] = srrptr+4; 579 579 } else if (net_ratelimit()) 580 - printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); 580 + pr_crit("%s(): Argh! Destination lost!\n", __func__); 581 581 if (opt->ts_needaddr) { 582 582 optptr = raw + opt->ts; 583 583 ip_rt_get_source(&optptr[optptr[2]-9], skb, rt);
+4 -4
net/ipv4/ipcomp.c
··· 156 156 static int __init ipcomp4_init(void) 157 157 { 158 158 if (xfrm_register_type(&ipcomp_type, AF_INET) < 0) { 159 - printk(KERN_INFO "ipcomp init: can't add xfrm type\n"); 159 + pr_info("%s: can't add xfrm type\n", __func__); 160 160 return -EAGAIN; 161 161 } 162 162 if (inet_add_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) { 163 - printk(KERN_INFO "ipcomp init: can't add protocol\n"); 163 + pr_info("%s: can't add protocol\n", __func__); 164 164 xfrm_unregister_type(&ipcomp_type, AF_INET); 165 165 return -EAGAIN; 166 166 } ··· 170 170 static void __exit ipcomp4_fini(void) 171 171 { 172 172 if (inet_del_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) 173 - printk(KERN_INFO "ip ipcomp close: can't remove protocol\n"); 173 + pr_info("%s: can't remove protocol\n", __func__); 174 174 if (xfrm_unregister_type(&ipcomp_type, AF_INET) < 0) 175 - printk(KERN_INFO "ip ipcomp close: can't remove xfrm type\n"); 175 + pr_info("%s: can't remove xfrm type\n", __func__); 176 176 } 177 177 178 178 module_init(ipcomp4_init);
+55 -55
net/ipv4/ipconfig.c
··· 214 214 if (!(dev->flags & IFF_LOOPBACK)) 215 215 continue; 216 216 if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) 217 - printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); 217 + pr_err("IP-Config: Failed to open %s\n", dev->name); 218 218 } 219 219 220 220 for_each_netdev(&init_net, dev) { ··· 223 223 if (dev->mtu >= 364) 224 224 able |= IC_BOOTP; 225 225 else 226 - printk(KERN_WARNING "DHCP/BOOTP: Ignoring device %s, MTU %d too small", dev->name, dev->mtu); 226 + pr_warn("DHCP/BOOTP: Ignoring device %s, MTU %d too small", 227 + dev->name, dev->mtu); 227 228 if (!(dev->flags & IFF_NOARP)) 228 229 able |= IC_RARP; 229 230 able &= ic_proto_enabled; ··· 232 231 continue; 233 232 oflags = dev->flags; 234 233 if (dev_change_flags(dev, oflags | IFF_UP) < 0) { 235 - printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); 234 + pr_err("IP-Config: Failed to open %s\n", 235 + dev->name); 236 236 continue; 237 237 } 238 238 if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { ··· 275 273 276 274 if (!ic_first_dev) { 277 275 if (user_dev_name[0]) 278 - printk(KERN_ERR "IP-Config: Device `%s' not found.\n", user_dev_name); 276 + pr_err("IP-Config: Device `%s' not found\n", 277 + user_dev_name); 279 278 else 280 - printk(KERN_ERR "IP-Config: No network devices available.\n"); 279 + pr_err("IP-Config: No network devices available\n"); 281 280 return -ENODEV; 282 281 } 283 282 return 0; ··· 362 359 strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); 363 360 set_sockaddr(sin, ic_myaddr, 0); 364 361 if ((err = ic_devinet_ioctl(SIOCSIFADDR, &ir)) < 0) { 365 - printk(KERN_ERR "IP-Config: Unable to set interface address (%d).\n", err); 362 + pr_err("IP-Config: Unable to set interface address (%d)\n", 363 + err); 366 364 return -1; 367 365 } 368 366 set_sockaddr(sin, ic_netmask, 0); 369 367 if ((err = ic_devinet_ioctl(SIOCSIFNETMASK, &ir)) < 0) { 370 - printk(KERN_ERR "IP-Config: Unable to set interface netmask (%d).\n", err); 368 + pr_err("IP-Config: Unable to set interface netmask (%d)\n", 369 + err); 371 370 return -1; 372 371 } 373 372 set_sockaddr(sin, ic_myaddr | ~ic_netmask, 0); 374 373 if ((err = ic_devinet_ioctl(SIOCSIFBRDADDR, &ir)) < 0) { 375 - printk(KERN_ERR "IP-Config: Unable to set interface broadcast address (%d).\n", err); 374 + pr_err("IP-Config: Unable to set interface broadcast address (%d)\n", 375 + err); 376 376 return -1; 377 377 } 378 378 /* Handle the case where we need non-standard MTU on the boot link (a network ··· 386 380 strcpy(ir.ifr_name, ic_dev->name); 387 381 ir.ifr_mtu = ic_dev_mtu; 388 382 if ((err = ic_dev_ioctl(SIOCSIFMTU, &ir)) < 0) 389 - printk(KERN_ERR "IP-Config: Unable to set interface mtu to %d (%d).\n", 390 - ic_dev_mtu, err); 383 + pr_err("IP-Config: Unable to set interface mtu to %d (%d)\n", 384 + ic_dev_mtu, err); 391 385 } 392 386 return 0; 393 387 } ··· 402 396 403 397 memset(&rm, 0, sizeof(rm)); 404 398 if ((ic_gateway ^ ic_myaddr) & ic_netmask) { 405 - printk(KERN_ERR "IP-Config: Gateway not on directly connected network.\n"); 399 + pr_err("IP-Config: Gateway not on directly connected network\n"); 406 400 return -1; 407 401 } 408 402 set_sockaddr((struct sockaddr_in *) &rm.rt_dst, 0, 0); ··· 410 404 set_sockaddr((struct sockaddr_in *) &rm.rt_gateway, ic_gateway, 0); 411 405 rm.rt_flags = RTF_UP | RTF_GATEWAY; 412 406 if ((err = ic_route_ioctl(SIOCADDRT, &rm)) < 0) { 413 - printk(KERN_ERR "IP-Config: Cannot add default route (%d).\n", err); 407 + pr_err("IP-Config: Cannot add default route (%d)\n", 408 + err); 414 409 return -1; 415 410 } 416 411 } ··· 444 437 else if (IN_CLASSC(ntohl(ic_myaddr))) 445 438 ic_netmask = htonl(IN_CLASSC_NET); 446 439 else { 447 - printk(KERN_ERR "IP-Config: Unable to guess netmask for address %pI4\n", 448 - &ic_myaddr); 440 + pr_err("IP-Config: Unable to guess netmask for address %pI4\n", 441 + &ic_myaddr); 449 442 return -1; 450 443 } 451 444 printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask); ··· 695 688 e += len; 696 689 } 697 690 if (*vendor_class_identifier) { 698 - printk(KERN_INFO "DHCP: sending class identifier \"%s\"\n", 699 - vendor_class_identifier); 691 + pr_info("DHCP: sending class identifier \"%s\"\n", 692 + vendor_class_identifier); 700 693 *e++ = 60; /* Class-identifier */ 701 694 len = strlen(vendor_class_identifier); 702 695 *e++ = len; ··· 956 949 /* Fragments are not supported */ 957 950 if (ip_is_fragment(h)) { 958 951 if (net_ratelimit()) 959 - printk(KERN_ERR "DHCP/BOOTP: Ignoring fragmented " 960 - "reply.\n"); 952 + pr_err("DHCP/BOOTP: Ignoring fragmented reply\n"); 961 953 goto drop; 962 954 } 963 955 ··· 1005 999 if (b->op != BOOTP_REPLY || 1006 1000 b->xid != d->xid) { 1007 1001 if (net_ratelimit()) 1008 - printk(KERN_ERR "DHCP/BOOTP: Reply not for us, " 1009 - "op[%x] xid[%x]\n", 1002 + pr_err("DHCP/BOOTP: Reply not for us, op[%x] xid[%x]\n", 1010 1003 b->op, b->xid); 1011 1004 goto drop_unlock; 1012 1005 } ··· 1013 1008 /* Is it a reply for the device we are configuring? */ 1014 1009 if (b->xid != ic_dev_xid) { 1015 1010 if (net_ratelimit()) 1016 - printk(KERN_ERR "DHCP/BOOTP: Ignoring delayed packet\n"); 1011 + pr_err("DHCP/BOOTP: Ignoring delayed packet\n"); 1017 1012 goto drop_unlock; 1018 1013 } 1019 1014 ··· 1151 1146 * are missing, and without DHCP/BOOTP/RARP we are unable to get it. 1152 1147 */ 1153 1148 if (!ic_proto_enabled) { 1154 - printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n"); 1149 + pr_err("IP-Config: Incomplete network configuration information\n"); 1155 1150 return -1; 1156 1151 } 1157 1152 1158 1153 #ifdef IPCONFIG_BOOTP 1159 1154 if ((ic_proto_enabled ^ ic_proto_have_if) & IC_BOOTP) 1160 - printk(KERN_ERR "DHCP/BOOTP: No suitable device found.\n"); 1155 + pr_err("DHCP/BOOTP: No suitable device found\n"); 1161 1156 #endif 1162 1157 #ifdef IPCONFIG_RARP 1163 1158 if ((ic_proto_enabled ^ ic_proto_have_if) & IC_RARP) 1164 - printk(KERN_ERR "RARP: No suitable device found.\n"); 1159 + pr_err("RARP: No suitable device found\n"); 1165 1160 #endif 1166 1161 1167 1162 if (!ic_proto_have_if) ··· 1188 1183 * [Actually we could now, but the nothing else running note still 1189 1184 * applies.. - AC] 1190 1185 */ 1191 - printk(KERN_NOTICE "Sending %s%s%s requests .", 1192 - do_bootp 1193 - ? ((ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP") : "", 1194 - (do_bootp && do_rarp) ? " and " : "", 1195 - do_rarp ? "RARP" : ""); 1186 + pr_notice("Sending %s%s%s requests .", 1187 + do_bootp 1188 + ? ((ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP") : "", 1189 + (do_bootp && do_rarp) ? " and " : "", 1190 + do_rarp ? "RARP" : ""); 1196 1191 1197 1192 start_jiffies = jiffies; 1198 1193 d = ic_first_dev; ··· 1221 1216 (ic_proto_enabled & IC_USE_DHCP) && 1222 1217 ic_dhcp_msgtype != DHCPACK) { 1223 1218 ic_got_reply = 0; 1224 - printk(KERN_CONT ","); 1219 + pr_cont(","); 1225 1220 continue; 1226 1221 } 1227 1222 #endif /* IPCONFIG_DHCP */ 1228 1223 1229 1224 if (ic_got_reply) { 1230 - printk(KERN_CONT " OK\n"); 1225 + pr_cont(" OK\n"); 1231 1226 break; 1232 1227 } 1233 1228 ··· 1235 1230 continue; 1236 1231 1237 1232 if (! --retries) { 1238 - printk(KERN_CONT " timed out!\n"); 1233 + pr_cont(" timed out!\n"); 1239 1234 break; 1240 1235 } 1241 1236 ··· 1245 1240 if (timeout > CONF_TIMEOUT_MAX) 1246 1241 timeout = CONF_TIMEOUT_MAX; 1247 1242 1248 - printk(KERN_CONT "."); 1243 + pr_cont("."); 1249 1244 } 1250 1245 1251 1246 #ifdef IPCONFIG_BOOTP ··· 1265 1260 printk("IP-Config: Got %s answer from %pI4, ", 1266 1261 ((ic_got_reply & IC_RARP) ? "RARP" 1267 1262 : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), 1268 - &ic_servaddr); 1269 - printk(KERN_CONT "my address is %pI4\n", &ic_myaddr); 1263 + &ic_servaddr); 1264 + pr_cont("my address is %pI4\n", &ic_myaddr); 1270 1265 1271 1266 return 0; 1272 1267 } ··· 1442 1437 */ 1443 1438 #ifdef CONFIG_ROOT_NFS 1444 1439 if (ROOT_DEV == Root_NFS) { 1445 - printk(KERN_ERR 1446 - "IP-Config: Retrying forever (NFS root)...\n"); 1440 + pr_err("IP-Config: Retrying forever (NFS root)...\n"); 1447 1441 goto try_try_again; 1448 1442 } 1449 1443 #endif 1450 1444 1451 1445 if (--retries) { 1452 - printk(KERN_ERR 1453 - "IP-Config: Reopening network devices...\n"); 1446 + pr_err("IP-Config: Reopening network devices...\n"); 1454 1447 goto try_try_again; 1455 1448 } 1456 1449 1457 1450 /* Oh, well. At least we tried. */ 1458 - printk(KERN_ERR "IP-Config: Auto-configuration of network failed.\n"); 1451 + pr_err("IP-Config: Auto-configuration of network failed\n"); 1459 1452 return -1; 1460 1453 } 1461 1454 #else /* !DYNAMIC */ 1462 - printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n"); 1455 + pr_err("IP-Config: Incomplete network configuration information\n"); 1463 1456 ic_close_devs(); 1464 1457 return -1; 1465 1458 #endif /* IPCONFIG_DYNAMIC */ ··· 1495 1492 /* 1496 1493 * Clue in the operator. 1497 1494 */ 1498 - printk("IP-Config: Complete:\n"); 1499 - printk(" device=%s", ic_dev->name); 1500 - printk(KERN_CONT ", addr=%pI4", &ic_myaddr); 1501 - printk(KERN_CONT ", mask=%pI4", &ic_netmask); 1502 - printk(KERN_CONT ", gw=%pI4", &ic_gateway); 1503 - printk(KERN_CONT ",\n host=%s, domain=%s, nis-domain=%s", 1504 - utsname()->nodename, ic_domain, utsname()->domainname); 1505 - printk(KERN_CONT ",\n bootserver=%pI4", &ic_servaddr); 1506 - printk(KERN_CONT ", rootserver=%pI4", &root_server_addr); 1507 - printk(KERN_CONT ", rootpath=%s", root_server_path); 1495 + pr_info("IP-Config: Complete:\n"); 1496 + pr_info(" device=%s, addr=%pI4, mask=%pI4, gw=%pI4\n", 1497 + ic_dev->name, &ic_myaddr, &ic_netmask, &ic_gateway); 1498 + pr_info(" host=%s, domain=%s, nis-domain=%s\n", 1499 + utsname()->nodename, ic_domain, utsname()->domainname); 1500 + pr_info(" bootserver=%pI4, rootserver=%pI4, rootpath=%s", 1501 + &ic_servaddr, &root_server_addr, root_server_path); 1508 1502 if (ic_dev_mtu) 1509 - printk(KERN_CONT ", mtu=%d", ic_dev_mtu); 1510 - printk(KERN_CONT "\n"); 1503 + pr_cont(", mtu=%d", ic_dev_mtu); 1504 + pr_cont("\n"); 1511 1505 #endif /* !SILENT */ 1512 1506 1513 1507 return 0; ··· 1637 1637 if (strlcpy(vendor_class_identifier, addrs, 1638 1638 sizeof(vendor_class_identifier)) 1639 1639 >= sizeof(vendor_class_identifier)) 1640 - printk(KERN_WARNING "DHCP: vendorclass too long, truncated to \"%s\"", 1641 - vendor_class_identifier); 1640 + pr_warn("DHCP: vendorclass too long, truncated to \"%s\"", 1641 + vendor_class_identifier); 1642 1642 return 1; 1643 1643 } 1644 1644
+2 -2
net/ipv4/ipip.c
··· 892 892 err = xfrm4_tunnel_register(&ipip_handler, AF_INET); 893 893 if (err < 0) { 894 894 unregister_pernet_device(&ipip_net_ops); 895 - printk(KERN_INFO "ipip init: can't register tunnel\n"); 895 + pr_info("%s: can't register tunnel\n", __func__); 896 896 } 897 897 return err; 898 898 } ··· 900 900 static void __exit ipip_fini(void) 901 901 { 902 902 if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET)) 903 - printk(KERN_INFO "ipip close: can't deregister tunnel\n"); 903 + pr_info("%s: can't deregister tunnel\n", __func__); 904 904 905 905 unregister_pernet_device(&ipip_net_ops); 906 906 }
+2 -2
net/ipv4/ipmr.c
··· 951 951 rcu_read_unlock(); 952 952 if (ret < 0) { 953 953 if (net_ratelimit()) 954 - printk(KERN_WARNING "mroute: pending queue full, dropping entries.\n"); 954 + pr_warn("mroute: pending queue full, dropping entries\n"); 955 955 kfree_skb(skb); 956 956 } 957 957 ··· 2538 2538 goto reg_notif_fail; 2539 2539 #ifdef CONFIG_IP_PIMSM_V2 2540 2540 if (inet_add_protocol(&pim_protocol, IPPROTO_PIM) < 0) { 2541 - printk(KERN_ERR "ip_mr_init: can't add PIM protocol\n"); 2541 + pr_err("%s: can't add PIM protocol\n", __func__); 2542 2542 err = -EAGAIN; 2543 2543 goto add_proto_fail; 2544 2544 }
+9 -9
net/ipv4/ping.c
··· 156 156 struct hlist_nulls_node *hnode; 157 157 158 158 pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n", 159 - (int)ident, &daddr, dif); 159 + (int)ident, &daddr, dif); 160 160 read_lock_bh(&ping_table.lock); 161 161 162 162 ping_portaddr_for_each_entry(sk, hnode, hslot) { ··· 229 229 static void ping_close(struct sock *sk, long timeout) 230 230 { 231 231 pr_debug("ping_close(sk=%p,sk->num=%u)\n", 232 - inet_sk(sk), inet_sk(sk)->inet_num); 232 + inet_sk(sk), inet_sk(sk)->inet_num); 233 233 pr_debug("isk->refcnt = %d\n", sk->sk_refcnt.counter); 234 234 235 235 sk_common_release(sk); ··· 252 252 return -EINVAL; 253 253 254 254 pr_debug("ping_v4_bind(sk=%p,sa_addr=%08x,sa_port=%d)\n", 255 - sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); 255 + sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); 256 256 257 257 chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); 258 258 if (addr->sin_addr.s_addr == htonl(INADDR_ANY)) ··· 280 280 } 281 281 282 282 pr_debug("after bind(): num = %d, daddr = %pI4, dif = %d\n", 283 - (int)isk->inet_num, 284 - &isk->inet_rcv_saddr, 285 - (int)sk->sk_bound_dev_if); 283 + (int)isk->inet_num, 284 + &isk->inet_rcv_saddr, 285 + (int)sk->sk_bound_dev_if); 286 286 287 287 err = 0; 288 288 if (isk->inet_rcv_saddr) ··· 335 335 return; 336 336 337 337 pr_debug("ping_err(type=%04x,code=%04x,id=%04x,seq=%04x)\n", type, 338 - code, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); 338 + code, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); 339 339 340 340 sk = ping_v4_lookup(net, iph->daddr, iph->saddr, 341 341 ntohs(icmph->un.echo.id), skb->dev->ifindex); ··· 679 679 static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) 680 680 { 681 681 pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", 682 - inet_sk(sk), inet_sk(sk)->inet_num, skb); 682 + inet_sk(sk), inet_sk(sk)->inet_num, skb); 683 683 if (sock_queue_rcv_skb(sk, skb) < 0) { 684 684 kfree_skb(skb); 685 685 pr_debug("ping_queue_rcv_skb -> failed\n"); ··· 705 705 /* We assume the packet has already been checked by icmp_rcv */ 706 706 707 707 pr_debug("ping_rcv(skb=%p,id=%04x,seq=%04x)\n", 708 - skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); 708 + skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); 709 709 710 710 /* Push ICMP header back */ 711 711 skb_push(skb, skb->data - (u8 *)icmph);
+2 -5
net/ipv4/raw.c
··· 491 491 if (msg->msg_namelen < sizeof(*usin)) 492 492 goto out; 493 493 if (usin->sin_family != AF_INET) { 494 - static int complained; 495 - if (!complained++) 496 - printk(KERN_INFO "%s forgot to set AF_INET in " 497 - "raw sendmsg. Fix it!\n", 498 - current->comm); 494 + pr_info_once("%s: %s forgot to set AF_INET. Fix it!\n", 495 + __func__, current->comm); 499 496 err = -EAFNOSUPPORT; 500 497 if (usin->sin_family) 501 498 goto out;
+18 -25
net/ipv4/route.c
··· 959 959 static void rt_emergency_hash_rebuild(struct net *net) 960 960 { 961 961 if (net_ratelimit()) 962 - printk(KERN_WARNING "Route hash chain too long!\n"); 962 + pr_warn("Route hash chain too long!\n"); 963 963 rt_cache_invalidate(net); 964 964 } 965 965 ··· 1083 1083 if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size) 1084 1084 goto out; 1085 1085 if (net_ratelimit()) 1086 - printk(KERN_WARNING "dst cache overflow\n"); 1086 + pr_warn("dst cache overflow\n"); 1087 1087 RT_CACHE_STAT_INC(gc_dst_overflow); 1088 1088 return 1; 1089 1089 ··· 1181 1181 int err = rt_bind_neighbour(rt); 1182 1182 if (err) { 1183 1183 if (net_ratelimit()) 1184 - printk(KERN_WARNING 1185 - "Neighbour table failure & not caching routes.\n"); 1184 + pr_warn("Neighbour table failure & not caching routes\n"); 1186 1185 ip_rt_put(rt); 1187 1186 return ERR_PTR(err); 1188 1187 } ··· 1257 1258 struct net *net = dev_net(rt->dst.dev); 1258 1259 int num = ++net->ipv4.current_rt_cache_rebuild_count; 1259 1260 if (!rt_caching(net)) { 1260 - printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n", 1261 + pr_warn("%s: %d rebuilds is over limit, route caching disabled\n", 1261 1262 rt->dst.dev->name, num); 1262 1263 } 1263 1264 rt_emergency_hash_rebuild(net); ··· 1298 1299 } 1299 1300 1300 1301 if (net_ratelimit()) 1301 - printk(KERN_WARNING "ipv4: Neighbour table overflow.\n"); 1302 + pr_warn("ipv4: Neighbour table overflow\n"); 1302 1303 rt_drop(rt); 1303 1304 return ERR_PTR(-ENOBUFS); 1304 1305 } ··· 1502 1503 reject_redirect: 1503 1504 #ifdef CONFIG_IP_ROUTE_VERBOSE 1504 1505 if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) 1505 - printk(KERN_INFO "Redirect from %pI4 on %s about %pI4 ignored.\n" 1506 + pr_info("Redirect from %pI4 on %s about %pI4 ignored\n" 1506 1507 " Advised path = %pI4 -> %pI4\n", 1507 - &old_gw, dev->name, &new_gw, 1508 - &saddr, &daddr); 1508 + &old_gw, dev->name, &new_gw, 1509 + &saddr, &daddr); 1509 1510 #endif 1510 1511 ; 1511 1512 } ··· 1617 1618 if (log_martians && 1618 1619 peer->rate_tokens == ip_rt_redirect_number && 1619 1620 net_ratelimit()) 1620 - printk(KERN_WARNING "host %pI4/if%d ignores redirects for %pI4 to %pI4.\n", 1621 - &ip_hdr(skb)->saddr, rt->rt_iif, 1621 + pr_warn("host %pI4/if%d ignores redirects for %pI4 to %pI4\n", 1622 + &ip_hdr(skb)->saddr, rt->rt_iif, 1622 1623 &rt->rt_dst, &rt->rt_gateway); 1623 1624 #endif 1624 1625 } ··· 2104 2105 * RFC1812 recommendation, if source is martian, 2105 2106 * the only hint is MAC header. 2106 2107 */ 2107 - printk(KERN_WARNING "martian source %pI4 from %pI4, on dev %s\n", 2108 + pr_warn("martian source %pI4 from %pI4, on dev %s\n", 2108 2109 &daddr, &saddr, dev->name); 2109 2110 if (dev->hard_header_len && skb_mac_header_was_set(skb)) { 2110 - int i; 2111 - const unsigned char *p = skb_mac_header(skb); 2112 - printk(KERN_WARNING "ll header: "); 2113 - for (i = 0; i < dev->hard_header_len; i++, p++) { 2114 - printk("%02x", *p); 2115 - if (i < (dev->hard_header_len - 1)) 2116 - printk(":"); 2117 - } 2118 - printk("\n"); 2111 + print_hex_dump(KERN_WARNING, "ll header: ", 2112 + DUMP_PREFIX_OFFSET, 16, 1, 2113 + skb_mac_header(skb), 2114 + dev->hard_header_len, true); 2119 2115 } 2120 2116 } 2121 2117 #endif ··· 2134 2140 out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res)); 2135 2141 if (out_dev == NULL) { 2136 2142 if (net_ratelimit()) 2137 - printk(KERN_CRIT "Bug in ip_route_input" \ 2138 - "_slow(). Please, report\n"); 2143 + pr_crit("Bug in ip_route_input_slow(). Please report.\n"); 2139 2144 return -EINVAL; 2140 2145 } 2141 2146 ··· 2406 2413 RT_CACHE_STAT_INC(in_martian_dst); 2407 2414 #ifdef CONFIG_IP_ROUTE_VERBOSE 2408 2415 if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) 2409 - printk(KERN_WARNING "martian destination %pI4 from %pI4, dev %s\n", 2416 + pr_warn("martian destination %pI4 from %pI4, dev %s\n", 2410 2417 &daddr, &saddr, dev->name); 2411 2418 #endif 2412 2419 ··· 3483 3490 net_random() % ip_rt_gc_interval + ip_rt_gc_interval); 3484 3491 3485 3492 if (ip_rt_proc_init()) 3486 - printk(KERN_ERR "Unable to create route proc files\n"); 3493 + pr_err("Unable to create route proc files\n"); 3487 3494 #ifdef CONFIG_XFRM 3488 3495 xfrm_init(); 3489 3496 xfrm4_init(ip_rt_max_size);
+3 -4
net/ipv4/tcp.c
··· 1675 1675 1676 1676 if (tp->ucopy.dma_cookie < 0) { 1677 1677 1678 - printk(KERN_ALERT "dma_cookie < 0\n"); 1678 + pr_alert("dma_cookie < 0\n"); 1679 1679 1680 1680 /* Exception. Bailout! */ 1681 1681 if (!copied) ··· 3311 3311 sysctl_tcp_rmem[1] = 87380; 3312 3312 sysctl_tcp_rmem[2] = max(87380, max_share); 3313 3313 3314 - printk(KERN_INFO "TCP: Hash tables configured " 3315 - "(established %u bind %u)\n", 3316 - tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3314 + pr_info("TCP: Hash tables configured (established %u bind %u)\n", 3315 + tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3317 3316 3318 3317 tcp_register_congestion_control(&tcp_reno); 3319 3318
+3 -4
net/ipv4/tcp_cong.c
··· 41 41 42 42 /* all algorithms must implement ssthresh and cong_avoid ops */ 43 43 if (!ca->ssthresh || !ca->cong_avoid) { 44 - printk(KERN_ERR "TCP %s does not implement required ops\n", 45 - ca->name); 44 + pr_err("TCP %s does not implement required ops\n", ca->name); 46 45 return -EINVAL; 47 46 } 48 47 49 48 spin_lock(&tcp_cong_list_lock); 50 49 if (tcp_ca_find(ca->name)) { 51 - printk(KERN_NOTICE "TCP %s already registered\n", ca->name); 50 + pr_notice("TCP %s already registered\n", ca->name); 52 51 ret = -EEXIST; 53 52 } else { 54 53 list_add_tail_rcu(&ca->list, &tcp_cong_list); 55 - printk(KERN_INFO "TCP %s registered\n", ca->name); 54 + pr_info("TCP %s registered\n", ca->name); 56 55 } 57 56 spin_unlock(&tcp_cong_list_lock); 58 57
+4 -4
net/ipv4/tcp_input.c
··· 3867 3867 opt_rx->wscale_ok = 1; 3868 3868 if (snd_wscale > 14) { 3869 3869 if (net_ratelimit()) 3870 - printk(KERN_INFO "tcp_parse_options: Illegal window " 3871 - "scaling value %d >14 received.\n", 3872 - snd_wscale); 3870 + pr_info("%s: Illegal window scaling value %d >14 received\n", 3871 + __func__, 3872 + snd_wscale); 3873 3873 snd_wscale = 14; 3874 3874 } 3875 3875 opt_rx->snd_wscale = snd_wscale; ··· 4191 4191 /* Only TCP_LISTEN and TCP_CLOSE are left, in these 4192 4192 * cases we should never reach this piece of code. 4193 4193 */ 4194 - printk(KERN_ERR "%s: Impossible, sk->sk_state=%d\n", 4194 + pr_err("%s: Impossible, sk->sk_state=%d\n", 4195 4195 __func__, sk->sk_state); 4196 4196 break; 4197 4197 }
+4 -4
net/ipv4/tcp_ipv4.c
··· 1227 1227 1228 1228 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 1229 1229 if (net_ratelimit()) { 1230 - printk(KERN_INFO "MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", 1231 - &iph->saddr, ntohs(th->source), 1232 - &iph->daddr, ntohs(th->dest), 1233 - genhash ? " tcp_v4_calc_md5_hash failed" : ""); 1230 + pr_info("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", 1231 + &iph->saddr, ntohs(th->source), 1232 + &iph->daddr, ntohs(th->dest), 1233 + genhash ? " tcp_v4_calc_md5_hash failed" : ""); 1234 1234 } 1235 1235 return 1; 1236 1236 }
+4 -4
net/ipv4/tunnel4.c
··· 164 164 static int __init tunnel4_init(void) 165 165 { 166 166 if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) { 167 - printk(KERN_ERR "tunnel4 init: can't add protocol\n"); 167 + pr_err("%s: can't add protocol\n", __func__); 168 168 return -EAGAIN; 169 169 } 170 170 #if IS_ENABLED(CONFIG_IPV6) 171 171 if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { 172 - printk(KERN_ERR "tunnel64 init: can't add protocol\n"); 172 + pr_err("tunnel64 init: can't add protocol\n"); 173 173 inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); 174 174 return -EAGAIN; 175 175 } ··· 181 181 { 182 182 #if IS_ENABLED(CONFIG_IPV6) 183 183 if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) 184 - printk(KERN_ERR "tunnel64 close: can't remove protocol\n"); 184 + pr_err("tunnel64 close: can't remove protocol\n"); 185 185 #endif 186 186 if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP)) 187 - printk(KERN_ERR "tunnel4 close: can't remove protocol\n"); 187 + pr_err("tunnel4 close: can't remove protocol\n"); 188 188 } 189 189 190 190 module_init(tunnel4_init);
+2 -2
net/ipv4/udplite.c
··· 129 129 inet_register_protosw(&udplite4_protosw); 130 130 131 131 if (udplite4_proc_init()) 132 - printk(KERN_ERR "%s: Cannot register /proc!\n", __func__); 132 + pr_err("%s: Cannot register /proc!\n", __func__); 133 133 return; 134 134 135 135 out_unregister_proto: 136 136 proto_unregister(&udplite_prot); 137 137 out_register_err: 138 - printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __func__); 138 + pr_crit("%s: Cannot add UDP-Lite protocol\n", __func__); 139 139 }
+8 -6
net/ipv4/xfrm4_tunnel.c
··· 75 75 static int __init ipip_init(void) 76 76 { 77 77 if (xfrm_register_type(&ipip_type, AF_INET) < 0) { 78 - printk(KERN_INFO "ipip init: can't add xfrm type\n"); 78 + pr_info("%s: can't add xfrm type\n", __func__); 79 79 return -EAGAIN; 80 80 } 81 81 82 82 if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) { 83 - printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n"); 83 + pr_info("%s: can't add xfrm handler for AF_INET\n", __func__); 84 84 xfrm_unregister_type(&ipip_type, AF_INET); 85 85 return -EAGAIN; 86 86 } 87 87 #if IS_ENABLED(CONFIG_IPV6) 88 88 if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { 89 - printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n"); 89 + pr_info("%s: can't add xfrm handler for AF_INET6\n", __func__); 90 90 xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); 91 91 xfrm_unregister_type(&ipip_type, AF_INET); 92 92 return -EAGAIN; ··· 99 99 { 100 100 #if IS_ENABLED(CONFIG_IPV6) 101 101 if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) 102 - printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n"); 102 + pr_info("%s: can't remove xfrm handler for AF_INET6\n", 103 + __func__); 103 104 #endif 104 105 if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET)) 105 - printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET\n"); 106 + pr_info("%s: can't remove xfrm handler for AF_INET\n", 107 + __func__); 106 108 if (xfrm_unregister_type(&ipip_type, AF_INET) < 0) 107 - printk(KERN_INFO "ipip close: can't remove xfrm type\n"); 109 + pr_info("%s: can't remove xfrm type\n", __func__); 108 110 } 109 111 110 112 module_init(ipip_init);