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

net: ipv6: Standardize prefixes for message logging

Add #define pr_fmt(fmt) as appropriate.

Add "IPv6: " to appropriate files.

Convert printk(KERN_<LEVEL> to pr_<level> (but not KERN_DEBUG).
Standardize on "%s: " not "%s(): " when emitting __func__.
Use "%s: ", __func__ instead of embedding function name.
Coalesce formats, align arguments.

ADDRCONF output is now prefixed with "IPv6: "

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
f3213831 82251de2

+116 -120
+23 -30
net/ipv6/addrconf.c
··· 38 38 * status etc. 39 39 */ 40 40 41 + #define pr_fmt(fmt) "IPv6: " fmt 42 + 41 43 #include <linux/errno.h> 42 44 #include <linux/types.h> 43 45 #include <linux/kernel.h> ··· 329 327 WARN_ON(idev->mc_list != NULL); 330 328 331 329 #ifdef NET_REFCNT_DEBUG 332 - printk(KERN_DEBUG "in6_dev_finish_destroy: %s\n", dev ? dev->name : "NIL"); 330 + printk(KERN_DEBUG "%s: %s\n", __func__, dev ? dev->name : "NIL"); 333 331 #endif 334 332 dev_put(dev); 335 333 if (!idev->dead) { 336 - pr_warning("Freeing alive inet6 device %p\n", idev); 334 + pr_warn("Freeing alive inet6 device %p\n", idev); 337 335 return; 338 336 } 339 337 snmp6_free_dev(idev); ··· 374 372 375 373 if (snmp6_alloc_dev(ndev) < 0) { 376 374 ADBG((KERN_WARNING 377 - "%s(): cannot allocate memory for statistics; dev=%s.\n", 375 + "%s: cannot allocate memory for statistics; dev=%s.\n", 378 376 __func__, dev->name)); 379 377 neigh_parms_release(&nd_tbl, ndev->nd_parms); 380 378 dev_put(dev); ··· 384 382 385 383 if (snmp6_register_dev(ndev) < 0) { 386 384 ADBG((KERN_WARNING 387 - "%s(): cannot create /proc/net/dev_snmp6/%s\n", 385 + "%s: cannot create /proc/net/dev_snmp6/%s\n", 388 386 __func__, dev->name)); 389 387 neigh_parms_release(&nd_tbl, ndev->nd_parms); 390 388 ndev->dead = 1; ··· 402 400 403 401 #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) 404 402 if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) { 405 - printk(KERN_INFO 406 - "%s: Disabled Multicast RS\n", 407 - dev->name); 403 + pr_info("%s: Disabled Multicast RS\n", dev->name); 408 404 ndev->cnf.rtr_solicits = 0; 409 405 } 410 406 #endif ··· 551 551 pr_notice("Timer is still running, when freeing ifa=%p\n", ifp); 552 552 553 553 if (ifp->state != INET6_IFADDR_STATE_DEAD) { 554 - pr_warning("Freeing alive inet6 address %p\n", ifp); 554 + pr_warn("Freeing alive inet6 address %p\n", ifp); 555 555 return; 556 556 } 557 557 dst_release(&ifp->rt->dst); ··· 841 841 in6_dev_hold(idev); 842 842 if (idev->cnf.use_tempaddr <= 0) { 843 843 write_unlock(&idev->lock); 844 - printk(KERN_INFO 845 - "ipv6_create_tempaddr(): use_tempaddr is disabled.\n"); 844 + pr_info("%s: use_tempaddr is disabled\n", __func__); 846 845 in6_dev_put(idev); 847 846 ret = -1; 848 847 goto out; ··· 851 852 idev->cnf.use_tempaddr = -1; /*XXX*/ 852 853 spin_unlock_bh(&ifp->lock); 853 854 write_unlock(&idev->lock); 854 - printk(KERN_WARNING 855 - "ipv6_create_tempaddr(): regeneration time exceeded. disabled temporary address support.\n"); 855 + pr_warn("%s: regeneration time exceeded - disabled temporary address support\n", 856 + __func__); 856 857 in6_dev_put(idev); 857 858 ret = -1; 858 859 goto out; ··· 862 863 if (__ipv6_try_regen_rndid(idev, tmpaddr) < 0) { 863 864 spin_unlock_bh(&ifp->lock); 864 865 write_unlock(&idev->lock); 865 - printk(KERN_WARNING 866 - "ipv6_create_tempaddr(): regeneration of randomized interface id failed.\n"); 866 + pr_warn("%s: regeneration of randomized interface id failed\n", 867 + __func__); 867 868 in6_ifa_put(ifp); 868 869 in6_dev_put(idev); 869 870 ret = -1; ··· 913 914 if (!ift || IS_ERR(ift)) { 914 915 in6_ifa_put(ifp); 915 916 in6_dev_put(idev); 916 - printk(KERN_INFO 917 - "ipv6_create_tempaddr(): retry temporary address regeneration.\n"); 917 + pr_info("%s: retry temporary address regeneration\n", __func__); 918 918 tmpaddr = &addr; 919 919 write_lock(&idev->lock); 920 920 goto retry; ··· 1427 1429 /* DAD failed for link-local based on MAC address */ 1428 1430 idev->cnf.disable_ipv6 = 1; 1429 1431 1430 - printk(KERN_INFO "%s: IPv6 being disabled!\n", 1432 + pr_info("%s: IPv6 being disabled!\n", 1431 1433 ifp->idev->dev->name); 1432 1434 } 1433 1435 } ··· 1658 1660 idev->cnf.regen_max_retry * idev->cnf.dad_transmits * idev->nd_parms->retrans_time - 1659 1661 idev->cnf.max_desync_factor * HZ; 1660 1662 if (time_before(expires, jiffies)) { 1661 - printk(KERN_WARNING 1662 - "ipv6_regen_rndid(): too short regeneration interval; timer disabled for %s.\n", 1663 - idev->dev->name); 1663 + pr_warn("%s: too short regeneration interval; timer disabled for %s\n", 1664 + __func__, idev->dev->name); 1664 1665 goto out; 1665 1666 } 1666 1667 ··· 2504 2507 struct inet6_dev *idev; 2505 2508 struct in6_addr addr; 2506 2509 2507 - pr_info("ipv6: addrconf_gre_config(%s)\n", dev->name); 2510 + pr_info("%s(%s)\n", __func__, dev->name); 2508 2511 2509 2512 ASSERT_RTNL(); 2510 2513 ··· 2596 2599 if (event == NETDEV_UP) { 2597 2600 if (!addrconf_qdisc_ok(dev)) { 2598 2601 /* device is not ready yet. */ 2599 - printk(KERN_INFO 2600 - "ADDRCONF(NETDEV_UP): %s: " 2601 - "link is not ready\n", 2602 + pr_info("ADDRCONF(NETDEV_UP): %s: link is not ready\n", 2602 2603 dev->name); 2603 2604 break; 2604 2605 } ··· 2621 2626 idev->if_flags |= IF_READY; 2622 2627 } 2623 2628 2624 - printk(KERN_INFO 2625 - "ADDRCONF(NETDEV_CHANGE): %s: " 2626 - "link becomes ready\n", 2627 - dev->name); 2629 + pr_info("ADDRCONF(NETDEV_CHANGE): %s: link becomes ready\n", 2630 + dev->name); 2628 2631 2629 2632 run_pending = 1; 2630 2633 } ··· 4750 4757 4751 4758 err = ipv6_addr_label_init(); 4752 4759 if (err < 0) { 4753 - printk(KERN_CRIT "IPv6 Addrconf:" 4754 - " cannot initialize default policy table: %d.\n", err); 4760 + pr_crit("%s: cannot initialize default policy table: %d\n", 4761 + __func__, err); 4755 4762 goto out; 4756 4763 } 4757 4764
+1 -1
net/ipv6/addrlabel.c
··· 350 350 int err = 0; 351 351 int i; 352 352 353 - ADDRLABEL(KERN_DEBUG "%s()\n", __func__); 353 + ADDRLABEL(KERN_DEBUG "%s\n", __func__); 354 354 355 355 for (i = 0; i < ARRAY_SIZE(ip6addrlbl_init_table); i++) { 356 356 int ret = ip6addrlbl_add(net,
+5 -9
net/ipv6/af_inet6.c
··· 18 18 * 2 of the License, or (at your option) any later version. 19 19 */ 20 20 21 + #define pr_fmt(fmt) "IPv6: " fmt 21 22 22 23 #include <linux/module.h> 23 24 #include <linux/capability.h> ··· 613 612 return ret; 614 613 615 614 out_permanent: 616 - printk(KERN_ERR "Attempt to override permanent protocol %d.\n", 617 - protocol); 615 + pr_err("Attempt to override permanent protocol %d\n", protocol); 618 616 goto out; 619 617 620 618 out_illegal: 621 - printk(KERN_ERR 622 - "Ignoring attempt to register invalid socket type %d.\n", 619 + pr_err("Ignoring attempt to register invalid socket type %d\n", 623 620 p->type); 624 621 goto out; 625 622 } ··· 627 628 inet6_unregister_protosw(struct inet_protosw *p) 628 629 { 629 630 if (INET_PROTOSW_PERMANENT & p->flags) { 630 - printk(KERN_ERR 631 - "Attempt to unregister permanent protocol %d.\n", 631 + pr_err("Attempt to unregister permanent protocol %d\n", 632 632 p->protocol); 633 633 } else { 634 634 spin_lock_bh(&inetsw6_lock); ··· 1065 1067 INIT_LIST_HEAD(r); 1066 1068 1067 1069 if (disable_ipv6_mod) { 1068 - printk(KERN_INFO 1069 - "IPv6: Loaded, but administratively disabled, " 1070 - "reboot required to enable\n"); 1070 + pr_info("Loaded, but administratively disabled, reboot required to enable\n"); 1071 1071 goto out; 1072 1072 } 1073 1073
+9 -7
net/ipv6/ah6.c
··· 24 24 * This file is derived from net/ipv4/ah.c. 25 25 */ 26 26 27 + #define pr_fmt(fmt) "IPv6: " fmt 28 + 27 29 #include <crypto/hash.h> 28 30 #include <linux/module.h> 29 31 #include <linux/slab.h> ··· 661 659 662 660 if (aalg_desc->uinfo.auth.icv_fullbits/8 != 663 661 crypto_ahash_digestsize(ahash)) { 664 - printk(KERN_INFO "AH: %s digestsize %u != %hu\n", 665 - x->aalg->alg_name, crypto_ahash_digestsize(ahash), 666 - aalg_desc->uinfo.auth.icv_fullbits/8); 662 + pr_info("AH: %s digestsize %u != %hu\n", 663 + x->aalg->alg_name, crypto_ahash_digestsize(ahash), 664 + aalg_desc->uinfo.auth.icv_fullbits/8); 667 665 goto error; 668 666 } 669 667 ··· 729 727 static int __init ah6_init(void) 730 728 { 731 729 if (xfrm_register_type(&ah6_type, AF_INET6) < 0) { 732 - printk(KERN_INFO "ipv6 ah init: can't add xfrm type\n"); 730 + pr_info("%s: can't add xfrm type\n", __func__); 733 731 return -EAGAIN; 734 732 } 735 733 736 734 if (inet6_add_protocol(&ah6_protocol, IPPROTO_AH) < 0) { 737 - printk(KERN_INFO "ipv6 ah init: can't add protocol\n"); 735 + pr_info("%s: can't add protocol\n", __func__); 738 736 xfrm_unregister_type(&ah6_type, AF_INET6); 739 737 return -EAGAIN; 740 738 } ··· 745 743 static void __exit ah6_fini(void) 746 744 { 747 745 if (inet6_del_protocol(&ah6_protocol, IPPROTO_AH) < 0) 748 - printk(KERN_INFO "ipv6 ah close: can't remove protocol\n"); 746 + pr_info("%s: can't remove protocol\n", __func__); 749 747 750 748 if (xfrm_unregister_type(&ah6_type, AF_INET6) < 0) 751 - printk(KERN_INFO "ipv6 ah close: can't remove xfrm type\n"); 749 + pr_info("%s: can't remove xfrm type\n", __func__); 752 750 753 751 } 754 752
+6 -4
net/ipv6/esp6.c
··· 24 24 * This file is derived from net/ipv4/esp.c 25 25 */ 26 26 27 + #define pr_fmt(fmt) "IPv6: " fmt 28 + 27 29 #include <crypto/aead.h> 28 30 #include <crypto/authenc.h> 29 31 #include <linux/err.h> ··· 653 651 static int __init esp6_init(void) 654 652 { 655 653 if (xfrm_register_type(&esp6_type, AF_INET6) < 0) { 656 - printk(KERN_INFO "ipv6 esp init: can't add xfrm type\n"); 654 + pr_info("%s: can't add xfrm type\n", __func__); 657 655 return -EAGAIN; 658 656 } 659 657 if (inet6_add_protocol(&esp6_protocol, IPPROTO_ESP) < 0) { 660 - printk(KERN_INFO "ipv6 esp init: can't add protocol\n"); 658 + pr_info("%s: can't add protocol\n", __func__); 661 659 xfrm_unregister_type(&esp6_type, AF_INET6); 662 660 return -EAGAIN; 663 661 } ··· 668 666 static void __exit esp6_fini(void) 669 667 { 670 668 if (inet6_del_protocol(&esp6_protocol, IPPROTO_ESP) < 0) 671 - printk(KERN_INFO "ipv6 esp close: can't remove protocol\n"); 669 + pr_info("%s: can't remove protocol\n", __func__); 672 670 if (xfrm_unregister_type(&esp6_type, AF_INET6) < 0) 673 - printk(KERN_INFO "ipv6 esp close: can't remove xfrm type\n"); 671 + pr_info("%s: can't remove xfrm type\n", __func__); 674 672 } 675 673 676 674 module_init(esp6_init);
+4 -4
net/ipv6/icmp.c
··· 29 29 * Kazunori MIYAZAWA @USAGI: change output process to use ip6_append_data 30 30 */ 31 31 32 + #define pr_fmt(fmt) "IPv6: " fmt 33 + 32 34 #include <linux/module.h> 33 35 #include <linux/errno.h> 34 36 #include <linux/types.h> ··· 822 820 err = inet_ctl_sock_create(&sk, PF_INET6, 823 821 SOCK_RAW, IPPROTO_ICMPV6, net); 824 822 if (err < 0) { 825 - printk(KERN_ERR 826 - "Failed to initialize the ICMP6 control socket " 827 - "(err %d).\n", 823 + pr_err("Failed to initialize the ICMP6 control socket (err %d)\n", 828 824 err); 829 825 goto fail; 830 826 } ··· 881 881 return 0; 882 882 883 883 fail: 884 - printk(KERN_ERR "Failed to register ICMP6 protocol\n"); 884 + pr_err("Failed to register ICMP6 protocol\n"); 885 885 unregister_pernet_subsys(&icmpv6_sk_ops); 886 886 return err; 887 887 }
+10 -10
net/ipv6/ip6_fib.c
··· 18 18 * routing table. 19 19 * Ville Nuorvala: Fixed routing subtrees. 20 20 */ 21 + 22 + #define pr_fmt(fmt) "IPv6: " fmt 23 + 21 24 #include <linux/errno.h> 22 25 #include <linux/types.h> 23 26 #include <linux/net.h> ··· 454 451 !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit)) { 455 452 if (!allow_create) { 456 453 if (replace_required) { 457 - pr_warn("IPv6: Can't replace route, " 458 - "no match found\n"); 454 + pr_warn("Can't replace route, no match found\n"); 459 455 return ERR_PTR(-ENOENT); 460 456 } 461 - pr_warn("IPv6: NLM_F_CREATE should be set " 462 - "when creating new route\n"); 457 + pr_warn("NLM_F_CREATE should be set when creating new route\n"); 463 458 } 464 459 goto insert_above; 465 460 } ··· 500 499 * That would keep IPv6 consistent with IPv4 501 500 */ 502 501 if (replace_required) { 503 - pr_warn("IPv6: Can't replace route, no match found\n"); 502 + pr_warn("Can't replace route, no match found\n"); 504 503 return ERR_PTR(-ENOENT); 505 504 } 506 - pr_warn("IPv6: NLM_F_CREATE should be set " 507 - "when creating new route\n"); 505 + pr_warn("NLM_F_CREATE should be set when creating new route\n"); 508 506 } 509 507 /* 510 508 * We walked to the bottom of tree. ··· 696 696 */ 697 697 if (!replace) { 698 698 if (!add) 699 - pr_warn("IPv6: NLM_F_CREATE should be set when creating new route\n"); 699 + pr_warn("NLM_F_CREATE should be set when creating new route\n"); 700 700 701 701 add: 702 702 rt->dst.rt6_next = iter; ··· 715 715 if (!found) { 716 716 if (add) 717 717 goto add; 718 - pr_warn("IPv6: NLM_F_REPLACE set, but no existing node found!\n"); 718 + pr_warn("NLM_F_REPLACE set, but no existing node found!\n"); 719 719 return -ENOENT; 720 720 } 721 721 *ins = rt; ··· 768 768 replace_required = 1; 769 769 } 770 770 if (!allow_create && !replace_required) 771 - pr_warn("IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); 771 + pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); 772 772 773 773 fn = fib6_add_1(root, &rt->rt6i_dst.addr, sizeof(struct in6_addr), 774 774 rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst),
+10 -11
net/ipv6/ip6_tunnel.c
··· 18 18 * 19 19 */ 20 20 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 21 23 #include <linux/module.h> 22 24 #include <linux/capability.h> 23 25 #include <linux/errno.h> ··· 838 836 ldev = dev_get_by_index_rcu(net, p->link); 839 837 840 838 if (unlikely(!ipv6_chk_addr(net, &p->laddr, ldev, 0))) 841 - printk(KERN_WARNING 842 - "%s xmit: Local address not yet configured!\n", 843 - p->name); 839 + pr_warn("%s xmit: Local address not yet configured!\n", 840 + p->name); 844 841 else if (!ipv6_addr_is_multicast(&p->raddr) && 845 842 unlikely(ipv6_chk_addr(net, &p->raddr, NULL, 0))) 846 - printk(KERN_WARNING 847 - "%s xmit: Routing loop! " 848 - "Remote address found on this node!\n", 849 - p->name); 843 + pr_warn("%s xmit: Routing loop! Remote address found on this node!\n", 844 + p->name); 850 845 else 851 846 ret = 1; 852 847 rcu_read_unlock(); ··· 1541 1542 1542 1543 err = xfrm6_tunnel_register(&ip4ip6_handler, AF_INET); 1543 1544 if (err < 0) { 1544 - printk(KERN_ERR "ip6_tunnel init: can't register ip4ip6\n"); 1545 + pr_err("%s: can't register ip4ip6\n", __func__); 1545 1546 goto out_ip4ip6; 1546 1547 } 1547 1548 1548 1549 err = xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6); 1549 1550 if (err < 0) { 1550 - printk(KERN_ERR "ip6_tunnel init: can't register ip6ip6\n"); 1551 + pr_err("%s: can't register ip6ip6\n", __func__); 1551 1552 goto out_ip6ip6; 1552 1553 } 1553 1554 ··· 1568 1569 static void __exit ip6_tunnel_cleanup(void) 1569 1570 { 1570 1571 if (xfrm6_tunnel_deregister(&ip4ip6_handler, AF_INET)) 1571 - printk(KERN_INFO "ip6_tunnel close: can't deregister ip4ip6\n"); 1572 + pr_info("%s: can't deregister ip4ip6\n", __func__); 1572 1573 1573 1574 if (xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6)) 1574 - printk(KERN_INFO "ip6_tunnel close: can't deregister ip6ip6\n"); 1575 + pr_info("%s: can't deregister ip6ip6\n", __func__); 1575 1576 1576 1577 unregister_pernet_device(&ip6_tnl_net_ops); 1577 1578 }
+1 -1
net/ipv6/ip6mr.c
··· 1350 1350 goto reg_notif_fail; 1351 1351 #ifdef CONFIG_IPV6_PIMSM_V2 1352 1352 if (inet6_add_protocol(&pim6_protocol, IPPROTO_PIM) < 0) { 1353 - printk(KERN_ERR "ip6_mr_init: can't add PIM protocol\n"); 1353 + pr_err("%s: can't add PIM protocol\n", __func__); 1354 1354 err = -EAGAIN; 1355 1355 goto add_proto_fail; 1356 1356 }
+7 -4
net/ipv6/ipcomp6.c
··· 30 30 * The decompression of IP datagram MUST be done after the reassembly, 31 31 * AH/ESP processing. 32 32 */ 33 + 34 + #define pr_fmt(fmt) "IPv6: " fmt 35 + 33 36 #include <linux/module.h> 34 37 #include <net/ip.h> 35 38 #include <net/xfrm.h> ··· 193 190 static int __init ipcomp6_init(void) 194 191 { 195 192 if (xfrm_register_type(&ipcomp6_type, AF_INET6) < 0) { 196 - printk(KERN_INFO "ipcomp6 init: can't add xfrm type\n"); 193 + pr_info("%s: can't add xfrm type\n", __func__); 197 194 return -EAGAIN; 198 195 } 199 196 if (inet6_add_protocol(&ipcomp6_protocol, IPPROTO_COMP) < 0) { 200 - printk(KERN_INFO "ipcomp6 init: can't add protocol\n"); 197 + pr_info("%s: can't add protocol\n", __func__); 201 198 xfrm_unregister_type(&ipcomp6_type, AF_INET6); 202 199 return -EAGAIN; 203 200 } ··· 207 204 static void __exit ipcomp6_fini(void) 208 205 { 209 206 if (inet6_del_protocol(&ipcomp6_protocol, IPPROTO_COMP) < 0) 210 - printk(KERN_INFO "ipv6 ipcomp close: can't remove protocol\n"); 207 + pr_info("%s: can't remove protocol\n", __func__); 211 208 if (xfrm_unregister_type(&ipcomp6_type, AF_INET6) < 0) 212 - printk(KERN_INFO "ipv6 ipcomp close: can't remove xfrm type\n"); 209 + pr_info("%s: can't remove xfrm type\n", __func__); 213 210 } 214 211 215 212 module_init(ipcomp6_init);
+1 -2
net/ipv6/mcast.c
··· 2627 2627 err = inet_ctl_sock_create(&net->ipv6.igmp_sk, PF_INET6, 2628 2628 SOCK_RAW, IPPROTO_ICMPV6, net); 2629 2629 if (err < 0) { 2630 - printk(KERN_ERR 2631 - "Failed to initialize the IGMP6 control socket (err %d).\n", 2630 + pr_err("Failed to initialize the IGMP6 control socket (err %d)\n", 2632 2631 err); 2633 2632 goto out; 2634 2633 }
+15 -15
net/ipv6/mip6.c
··· 22 22 * Masahide NAKAMURA @USAGI 23 23 */ 24 24 25 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 26 + 25 27 #include <linux/module.h> 26 28 #include <linux/skbuff.h> 27 29 #include <linux/time.h> ··· 309 307 static int mip6_destopt_init_state(struct xfrm_state *x) 310 308 { 311 309 if (x->id.spi) { 312 - printk(KERN_INFO "%s: spi is not 0: %u\n", __func__, 313 - x->id.spi); 310 + pr_info("%s: spi is not 0: %u\n", __func__, x->id.spi); 314 311 return -EINVAL; 315 312 } 316 313 if (x->props.mode != XFRM_MODE_ROUTEOPTIMIZATION) { 317 - printk(KERN_INFO "%s: state's mode is not %u: %u\n", 318 - __func__, XFRM_MODE_ROUTEOPTIMIZATION, x->props.mode); 314 + pr_info("%s: state's mode is not %u: %u\n", 315 + __func__, XFRM_MODE_ROUTEOPTIMIZATION, x->props.mode); 319 316 return -EINVAL; 320 317 } 321 318 ··· 444 443 static int mip6_rthdr_init_state(struct xfrm_state *x) 445 444 { 446 445 if (x->id.spi) { 447 - printk(KERN_INFO "%s: spi is not 0: %u\n", __func__, 448 - x->id.spi); 446 + pr_info("%s: spi is not 0: %u\n", __func__, x->id.spi); 449 447 return -EINVAL; 450 448 } 451 449 if (x->props.mode != XFRM_MODE_ROUTEOPTIMIZATION) { 452 - printk(KERN_INFO "%s: state's mode is not %u: %u\n", 453 - __func__, XFRM_MODE_ROUTEOPTIMIZATION, x->props.mode); 450 + pr_info("%s: state's mode is not %u: %u\n", 451 + __func__, XFRM_MODE_ROUTEOPTIMIZATION, x->props.mode); 454 452 return -EINVAL; 455 453 } 456 454 ··· 481 481 482 482 static int __init mip6_init(void) 483 483 { 484 - printk(KERN_INFO "Mobile IPv6\n"); 484 + pr_info("Mobile IPv6\n"); 485 485 486 486 if (xfrm_register_type(&mip6_destopt_type, AF_INET6) < 0) { 487 - printk(KERN_INFO "%s: can't add xfrm type(destopt)\n", __func__); 487 + pr_info("%s: can't add xfrm type(destopt)\n", __func__); 488 488 goto mip6_destopt_xfrm_fail; 489 489 } 490 490 if (xfrm_register_type(&mip6_rthdr_type, AF_INET6) < 0) { 491 - printk(KERN_INFO "%s: can't add xfrm type(rthdr)\n", __func__); 491 + pr_info("%s: can't add xfrm type(rthdr)\n", __func__); 492 492 goto mip6_rthdr_xfrm_fail; 493 493 } 494 494 if (rawv6_mh_filter_register(mip6_mh_filter) < 0) { 495 - printk(KERN_INFO "%s: can't add rawv6 mh filter\n", __func__); 495 + pr_info("%s: can't add rawv6 mh filter\n", __func__); 496 496 goto mip6_rawv6_mh_fail; 497 497 } 498 498 ··· 510 510 static void __exit mip6_fini(void) 511 511 { 512 512 if (rawv6_mh_filter_unregister(mip6_mh_filter) < 0) 513 - printk(KERN_INFO "%s: can't remove rawv6 mh filter\n", __func__); 513 + pr_info("%s: can't remove rawv6 mh filter\n", __func__); 514 514 if (xfrm_unregister_type(&mip6_rthdr_type, AF_INET6) < 0) 515 - printk(KERN_INFO "%s: can't remove xfrm type(rthdr)\n", __func__); 515 + pr_info("%s: can't remove xfrm type(rthdr)\n", __func__); 516 516 if (xfrm_unregister_type(&mip6_destopt_type, AF_INET6) < 0) 517 - printk(KERN_INFO "%s: can't remove xfrm type(destopt)\n", __func__); 517 + pr_info("%s: can't remove xfrm type(destopt)\n", __func__); 518 518 } 519 519 520 520 module_init(mip6_init);
+9 -13
net/ipv6/ndisc.c
··· 266 266 case ND_OPT_REDIRECT_HDR: 267 267 if (ndopts->nd_opt_array[nd_opt->nd_opt_type]) { 268 268 ND_PRINTK2(KERN_WARNING 269 - "%s(): duplicated ND6 option found: type=%d\n", 269 + "%s: duplicated ND6 option found: type=%d\n", 270 270 __func__, 271 271 nd_opt->nd_opt_type); 272 272 } else { ··· 297 297 * protocol. 298 298 */ 299 299 ND_PRINTK2(KERN_NOTICE 300 - "%s(): ignored unsupported option; type=%d, len=%d\n", 300 + "%s: ignored unsupported option; type=%d, len=%d\n", 301 301 __func__, 302 302 nd_opt->nd_opt_type, nd_opt->nd_opt_len); 303 303 } ··· 459 459 1, &err); 460 460 if (!skb) { 461 461 ND_PRINTK0(KERN_ERR 462 - "ICMPv6 ND: %s() failed to allocate an skb, err=%d.\n", 462 + "ICMPv6 ND: %s failed to allocate an skb, err=%d.\n", 463 463 __func__, err); 464 464 return NULL; 465 465 } ··· 696 696 697 697 if ((probes -= neigh->parms->ucast_probes) < 0) { 698 698 if (!(neigh->nud_state & NUD_VALID)) { 699 - ND_PRINTK1(KERN_DEBUG "%s(): trying to ucast probe in NUD_INVALID: %pI6\n", 699 + ND_PRINTK1(KERN_DEBUG "%s: trying to ucast probe in NUD_INVALID: %pI6\n", 700 700 __func__, target); 701 701 } 702 702 ndisc_send_ns(dev, neigh, target, target, saddr); ··· 1230 1230 neigh = dst_neigh_lookup(&rt->dst, &ipv6_hdr(skb)->saddr); 1231 1231 if (!neigh) { 1232 1232 ND_PRINTK0(KERN_ERR 1233 - "ICMPv6 RA: %s() got default router without neighbour.\n", 1233 + "ICMPv6 RA: %s got default router without neighbour.\n", 1234 1234 __func__); 1235 1235 dst_release(&rt->dst); 1236 1236 return; ··· 1248 1248 rt = rt6_add_dflt_router(&ipv6_hdr(skb)->saddr, skb->dev, pref); 1249 1249 if (rt == NULL) { 1250 1250 ND_PRINTK0(KERN_ERR 1251 - "ICMPv6 RA: %s() failed to add default route.\n", 1251 + "ICMPv6 RA: %s failed to add default route.\n", 1252 1252 __func__); 1253 1253 return; 1254 1254 } ··· 1256 1256 neigh = dst_neigh_lookup(&rt->dst, &ipv6_hdr(skb)->saddr); 1257 1257 if (neigh == NULL) { 1258 1258 ND_PRINTK0(KERN_ERR 1259 - "ICMPv6 RA: %s() got default router without neighbour.\n", 1259 + "ICMPv6 RA: %s got default router without neighbour.\n", 1260 1260 __func__); 1261 1261 dst_release(&rt->dst); 1262 1262 return; ··· 1605 1605 1, &err); 1606 1606 if (buff == NULL) { 1607 1607 ND_PRINTK0(KERN_ERR 1608 - "ICMPv6 Redirect: %s() failed to allocate an skb, err=%d.\n", 1608 + "ICMPv6 Redirect: %s failed to allocate an skb, err=%d.\n", 1609 1609 __func__, err); 1610 1610 goto release; 1611 1611 } ··· 1767 1767 static int warned; 1768 1768 if (strcmp(warncomm, current->comm) && warned < 5) { 1769 1769 strcpy(warncomm, current->comm); 1770 - printk(KERN_WARNING 1771 - "process `%s' is using deprecated sysctl (%s) " 1772 - "net.ipv6.neigh.%s.%s; " 1773 - "Use net.ipv6.neigh.%s.%s_ms " 1774 - "instead.\n", 1770 + pr_warn("process `%s' is using deprecated sysctl (%s) net.ipv6.neigh.%s.%s - use net.ipv6.neigh.%s.%s_ms instead\n", 1775 1771 warncomm, func, 1776 1772 dev_name, ctl->procname, 1777 1773 dev_name, ctl->procname);
+5 -3
net/ipv6/route.c
··· 24 24 * Fixed routing subtrees. 25 25 */ 26 26 27 + #define pr_fmt(fmt) "IPv6: " fmt 28 + 27 29 #include <linux/capability.h> 28 30 #include <linux/errno.h> 29 31 #include <linux/export.h> ··· 796 794 goto retry; 797 795 } 798 796 799 - net_warn_ratelimited("ipv6: Neighbour table overflow\n"); 797 + net_warn_ratelimited("Neighbour table overflow\n"); 800 798 dst_free(&rt->dst); 801 799 return NULL; 802 800 } ··· 1282 1280 !(cfg->fc_nlinfo.nlh->nlmsg_flags & NLM_F_CREATE)) { 1283 1281 table = fib6_get_table(net, cfg->fc_table); 1284 1282 if (!table) { 1285 - printk(KERN_WARNING "IPv6: NLM_F_CREATE should be specified when creating new route\n"); 1283 + pr_warn("NLM_F_CREATE should be specified when creating new route\n"); 1286 1284 table = fib6_new_table(net, cfg->fc_table); 1287 1285 } 1288 1286 } else { ··· 2104 2102 int err; 2105 2103 2106 2104 if (!rt) { 2107 - net_warn_ratelimited("IPv6: Maximum number of routes reached, consider increasing route/max_size\n"); 2105 + net_warn_ratelimited("Maximum number of routes reached, consider increasing route/max_size\n"); 2108 2106 return ERR_PTR(-ENOMEM); 2109 2107 } 2110 2108
+4 -2
net/ipv6/sit.c
··· 17 17 * Fred Templin <fred.l.templin@boeing.com>: isatap support 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/module.h> 21 23 #include <linux/capability.h> 22 24 #include <linux/errno.h> ··· 1303 1301 { 1304 1302 int err; 1305 1303 1306 - printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n"); 1304 + pr_info("IPv6 over IPv4 tunneling driver\n"); 1307 1305 1308 1306 err = register_pernet_device(&sit_net_ops); 1309 1307 if (err < 0) ··· 1311 1309 err = xfrm4_tunnel_register(&sit_handler, AF_INET6); 1312 1310 if (err < 0) { 1313 1311 unregister_pernet_device(&sit_net_ops); 1314 - printk(KERN_INFO "sit init: Can't add protocol\n"); 1312 + pr_info("%s: can't add protocol\n", __func__); 1315 1313 } 1316 1314 return err; 1317 1315 }
+6 -4
net/ipv6/tunnel6.c
··· 19 19 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> 20 20 */ 21 21 22 + #define pr_fmt(fmt) "IPv6: " fmt 23 + 22 24 #include <linux/icmpv6.h> 23 25 #include <linux/init.h> 24 26 #include <linux/module.h> ··· 162 160 static int __init tunnel6_init(void) 163 161 { 164 162 if (inet6_add_protocol(&tunnel6_protocol, IPPROTO_IPV6)) { 165 - printk(KERN_ERR "tunnel6 init(): can't add protocol\n"); 163 + pr_err("%s: can't add protocol\n", __func__); 166 164 return -EAGAIN; 167 165 } 168 166 if (inet6_add_protocol(&tunnel46_protocol, IPPROTO_IPIP)) { 169 - printk(KERN_ERR "tunnel6 init(): can't add protocol\n"); 167 + pr_err("%s: can't add protocol\n", __func__); 170 168 inet6_del_protocol(&tunnel6_protocol, IPPROTO_IPV6); 171 169 return -EAGAIN; 172 170 } ··· 176 174 static void __exit tunnel6_fini(void) 177 175 { 178 176 if (inet6_del_protocol(&tunnel46_protocol, IPPROTO_IPIP)) 179 - printk(KERN_ERR "tunnel6 close: can't remove protocol\n"); 177 + pr_err("%s: can't remove protocol\n", __func__); 180 178 if (inet6_del_protocol(&tunnel6_protocol, IPPROTO_IPV6)) 181 - printk(KERN_ERR "tunnel6 close: can't remove protocol\n"); 179 + pr_err("%s: can't remove protocol\n", __func__); 182 180 } 183 181 184 182 module_init(tunnel6_init);