net: Convert printks to pr_<level>
Subsystems (6)
PATCH 1/1 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
--- net/ipv4/af_inet.c | 25 +++++------ net/ipv4/ah4.c | 14 +++--- net/ipv4/esp4.c | 8 ++-- net/ipv4/fib_frontend.c | 6 +- net/ipv4/fib_semantics.c | 2 +- net/ipv4/fib_trie.c | 5 +- net/ipv4/icmp.c | 19 +++----- net/ipv4/ip_fragment.c | 3 +- net/ipv4/ip_gre.c | 6 +- net/ipv4/ip_input.c | 4 +- net/ipv4/ip_options.c | 2 +- net/ipv4/ipcomp.c | 8 ++-- net/ipv4/ipconfig.c | 110 +++++++++++++++++++++++----------------------- net/ipv4/ipip.c | 4 +- net/ipv4/ipmr.c | 4 +- net/ipv4/ping.c | 18 ++++---- net/ipv4/raw.c | 7 +-- net/ipv4/route.c | 43 ++++++++---------- net/ipv4/tcp.c | 7 +-- net/ipv4/tcp_cong.c | 7 +-- net/ipv4/tcp_input.c | 8 ++-- net/ipv4/tcp_ipv4.c | 8 ++-- net/ipv4/tunnel4.c | 8 ++-- net/ipv4/udplite.c | 4 +- net/ipv4/xfrm4_tunnel.c | 14 +++--- 25 files changed, 163 insertions(+), 181 deletions(-)
net/ipv4/af_inet.c +11 -14
@@ -1085,13 +1085,11 @@ out:return ; out_permanent: -printk (KERN_ERR "Attempt to override permanent protocol %d.\n" , - protocol); +pr_err ("Attempt to override permanent protocol %d\n" , protocol); goto out; out_illegal: -printk (KERN_ERR -"Ignoring attempt to register invalid socket type %d.\n" , +pr_err ("Ignoring attempt to register invalid socket type %d\n" , p->type); goto out; }
@@ -1100,8 +1098,7 @@ EXPORT_SYMBOL(inet_register_protosw);void inet_unregister_protosw (struct inet_protosw *p) {if (INET_PROTOSW_PERMANENT & p->flags) { -printk (KERN_ERR -"Attempt to unregister permanent protocol %d.\n" , +pr_err ("Attempt to unregister permanent protocol %d\n" , p->protocol); }else {spin_lock_bh (&inetsw_lock);
@@ -1150,8 +1147,8 @@ static int inet_sk_reselect_saddr(struct sock *sk)return 0 ;if (sysctl_ip_dynaddr >1 ) { -printk (KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n" , - __func__, &old_saddr, &new_saddr); +pr_info ("%s(): shifting inet->saddr from %pI4 to %pI4\n" , + __func__, &old_saddr, &new_saddr); } inet->inet_saddr = inet->inet_rcv_saddr = new_saddr;
@@ -1680,14 +1677,14 @@ static int __init inet_init(void)*/ if (inet_add_protocol (&icmp_protocol,IPPROTO_ICMP ) <0 ) -printk (KERN_CRIT "inet_init: Cannot add ICMP protocol\n" ); +pr_crit ("%s: Cannot add ICMP protocol\n" , __func__);if (inet_add_protocol (&udp_protocol,IPPROTO_UDP ) <0 ) -printk (KERN_CRIT "inet_init: Cannot add UDP protocol\n" ); +pr_crit ("%s: Cannot add UDP protocol\n" , __func__);if (inet_add_protocol (&tcp_protocol,IPPROTO_TCP ) <0 ) -printk (KERN_CRIT "inet_init: Cannot add TCP protocol\n" ); +pr_crit ("%s: Cannot add TCP protocol\n" , __func__);#ifdef CONFIG_IP_MULTICAST if (inet_add_protocol (&igmp_protocol,IPPROTO_IGMP ) <0 ) -printk (KERN_CRIT "inet_init: Cannot add IGMP protocol\n" ); +pr_crit ("%s: Cannot add IGMP protocol\n" , __func__);#endif /* Register the socket-side information for inet_create. */
@@ -1734,14 +1731,14 @@ static int __init inet_init(void)*/ #if defined(CONFIG_IP_MROUTE )if (ip_mr_init ()) -printk (KERN_CRIT "inet_init: Cannot init ipv4 mroute\n" ); +pr_crit ("%s: Cannot init ipv4 mroute\n" , __func__);#endif /* * Initialise per-cpu ipv4 mibs */ if (init_ipv4_mibs ()) -printk (KERN_CRIT "inet_init: Cannot init ipv4 mibs\n" ); +pr_crit ("%s: Cannot init ipv4 mibs\n" , __func__);ipv4_proc_init ();
net/ipv4/ah4.c +7 -7
@@ -445,9 +445,9 @@ static int ah_init_state(struct xfrm_state *x)if (aalg_desc->uinfo.auth.icv_fullbits/8 !=crypto_ahash_digestsize (ahash)) { -printk (KERN_INFO "AH: %s digestsize %u != %hu\n" , - x->aalg->alg_name,crypto_ahash_digestsize (ahash), - aalg_desc->uinfo.auth.icv_fullbits/8 ); +pr_info ("AH: %s digestsize %u != %hu\n" , + x->aalg->alg_name,crypto_ahash_digestsize (ahash), + aalg_desc->uinfo.auth.icv_fullbits/8 ); goto error; }
@@ -510,11 +510,11 @@ static const struct net_protocol ah4_protocol = {static int __init ah4_init (void ) {if (xfrm_register_type (&ah_type,AF_INET ) <0 ) { -printk (KERN_INFO "ip ah init: can't add xfrm type\n" ); +pr_info ("%s: can't add xfrm type\n" , __func__);return -EAGAIN ; }if (inet_add_protocol (&ah4_protocol,IPPROTO_AH ) <0 ) { -printk (KERN_INFO "ip ah init: can't add protocol\n" ); +pr_info ("%s: can't add protocol\n" , __func__);xfrm_unregister_type (&ah_type,AF_INET );return -EAGAIN ; }
@@ -524,9 +524,9 @@ static int __init ah4_init(void) static void __exit ah4_fini(void) {if (inet_del_protocol (&ah4_protocol,IPPROTO_AH ) <0 ) -printk (KERN_INFO "ip ah close: can't remove protocol\n" ); +pr_info ("%s: can't remove protocol\n" , __func__);if (xfrm_unregister_type (&ah_type,AF_INET ) <0 ) -printk (KERN_INFO "ip ah close: can't remove xfrm type\n" ); +pr_info ("%s: can't remove xfrm type\n" , __func__); }module_init (ah4_init);
net/ipv4/esp4.c +4 -4
@@ -706,11 +706,11 @@ static const struct net_protocol esp4_protocol = {static int __init esp4_init (void ) {if (xfrm_register_type (&esp_type,AF_INET ) <0 ) { -printk (KERN_INFO "ip esp init: can't add xfrm type\n" ); +pr_info ("%s: can't add xfrm type\n" , __func__);return -EAGAIN ; }if (inet_add_protocol (&esp4_protocol,IPPROTO_ESP ) <0 ) { -printk (KERN_INFO "ip esp init: can't add protocol\n" ); +pr_info ("%s: can't add protocol\n" , __func__);xfrm_unregister_type (&esp_type,AF_INET );return -EAGAIN ; }
@@ -720,9 +720,9 @@ static int __init esp4_init(void) static void __exit esp4_fini(void) {if (inet_del_protocol (&esp4_protocol,IPPROTO_ESP ) <0 ) -printk (KERN_INFO "ip esp close: can't remove protocol\n" ); +pr_info ("%s: can't remove protocol\n" , __func__);if (xfrm_unregister_type (&esp_type,AF_INET ) <0 ) -printk (KERN_INFO "ip esp close: can't remove xfrm type\n" ); +pr_info ("%s: can't remove xfrm type\n" , __func__); }module_init (esp4_init);
net/ipv4/fib_frontend.c +3 -3
@@ -695,7 +695,7 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)if (ifa->ifa_flags &IFA_F_SECONDARY ) { prim =inet_ifa_byprefix (in_dev, prefix, mask);if (prim ==NULL ) { -printk (KERN_WARNING "fib_add_ifaddr: bug: prim == NULL\n" ); +pr_warn ("%s: bug: prim == NULL\n" , __func__);return ; } }
@@ -749,11 +749,11 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)if (ifa->ifa_flags &IFA_F_SECONDARY ) { prim =inet_ifa_byprefix (in_dev, any, ifa->ifa_mask);if (prim ==NULL ) { -printk (KERN_WARNING "fib_del_ifaddr: bug: prim == NULL\n" ); +pr_warn ("%s: bug: prim == NULL\n" , __func__);return ; }if (iprim && iprim != prim) { -printk (KERN_WARNING "fib_del_ifaddr: bug: iprim != prim\n" ); +pr_warn ("%s: bug: iprim != prim\n" , __func__);return ; } } else if (!ipv4_is_zeronet(any) &&
net/ipv4/fib_semantics.c +1 -1
@@ -154,7 +154,7 @@ static void free_fib_info_rcu(struct rcu_head *head)void free_fib_info (struct fib_info *fi) {if (fi->fib_dead ==0 ) { -pr_warning ("Freeing alive fib_info %p\n" , fi); +pr_warn ("Freeing alive fib_info %p\n" , fi);return ; }change_nexthops (fi) {
net/ipv4/fib_trie.c +2 -3
@@ -1170,9 +1170,8 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen) }if (tp && tp->pos + tp->bits >32 ) -pr_warning ("fib_trie" -" tp=%p pos=%d, bits=%d, key=%0x plen=%d\n" , - tp, tp->pos, tp->bits, key, plen); +pr_warn ("fib_trie tp=%p pos=%d, bits=%d, key=%0x plen=%d\n" , + tp, tp->pos, tp->bits, key, plen);/* Rebalance the trie */
net/ipv4/icmp.c +8 -11
@@ -670,7 +670,7 @@ static void icmp_unreach(struct sk_buff *skb)break ;case ICMP_FRAG_NEEDED :if (ipv4_config.no_pmtu_disc) { -LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n" , +LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: fragmentation needed and DF set\n" , &iph->daddr); }else { info = ip_rt_frag_needed(net, iph,
@@ -681,7 +681,7 @@ static void icmp_unreach(struct sk_buff *skb) }break ;case ICMP_SR_FAILED : -LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: Source Route Failed.\n" , +LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: Source Route Failed\n" , &iph->daddr);break ;default :
@@ -713,13 +713,10 @@ static void icmp_unreach(struct sk_buff *skb)if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&inet_addr_type (net, iph->daddr) ==RTN_BROADCAST ) {if (net_ratelimit ()) -printk (KERN_WARNING "%pI4 sent an invalid ICMP " -"type %u, code %u " -"error to a broadcast: %pI4 on %s\n" , - &ip_hdr (skb)->saddr, - icmph->type, icmph->code, - &iph->daddr, - skb->dev->name); +pr_warn ("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n" , + &ip_hdr (skb)->saddr, + icmph->type, icmph->code, + &iph->daddr, skb->dev->name); goto out; }
@@ -946,8 +943,8 @@ static void icmp_address_reply(struct sk_buff *skb)break ; }if (!ifa &&net_ratelimit ()) { -printk (KERN_INFO "Wrong address mask %pI4 from %s/%pI4\n" , - mp, dev->name, &ip_hdr (skb)->saddr); +pr_info ("Wrong address mask %pI4 from %s/%pI4\n" , + mp, dev->name, &ip_hdr (skb)->saddr); } } }
net/ipv4/ip_fragment.c +1 -2
@@ -643,8 +643,7 @@ out_nomem: goto out_fail; out_oversize:if (net_ratelimit ()) -printk (KERN_INFO "Oversized IP packet from %pI4.\n" , - &qp->saddr); +pr_info ("Oversized IP packet from %pI4\n" , &qp->saddr); out_fail:IP_INC_STATS_BH (net,IPSTATS_MIB_REASMFAILS );return err;
net/ipv4/ip_gre.c +3 -3
@@ -1716,7 +1716,7 @@ static int __init ipgre_init(void) {int err; -printk (KERN_INFO "GRE over IPv4 tunneling driver\n" ); +pr_info ("GRE over IPv4 tunneling driver\n" ); err =register_pernet_device (&ipgre_net_ops);if (err <0 )
@@ -1724,7 +1724,7 @@ static int __init ipgre_init(void) err =gre_add_protocol (&ipgre_protocol,GREPROTO_CISCO );if (err <0 ) { -printk (KERN_INFO "ipgre init: can't add protocol\n" ); +pr_info ("%s: can't add protocol\n" , __func__); goto add_proto_failed; }
@@ -1753,7 +1753,7 @@ static void __exit ipgre_fini(void)rtnl_link_unregister (&ipgre_tap_ops);rtnl_link_unregister (&ipgre_link_ops);if (gre_del_protocol (&ipgre_protocol,GREPROTO_CISCO ) <0 ) -printk (KERN_INFO "ipgre close: can't remove protocol\n" ); +pr_info ("%s: can't remove protocol\n" , __func__);unregister_pernet_device (&ipgre_net_ops); }
net/ipv4/ip_input.c +2 -2
@@ -299,8 +299,8 @@ static inline bool ip_rcv_options(struct sk_buff *skb)if (!IN_DEV_SOURCE_ROUTE (in_dev)) {if (IN_DEV_LOG_MARTIANS (in_dev) &&net_ratelimit ()) -printk (KERN_INFO "source route option %pI4 -> %pI4\n" , - &iph->saddr, &iph->daddr); +pr_info ("source route option %pI4 -> %pI4\n" , + &iph->saddr, &iph->daddr); goto drop; } }
net/ipv4/ip_options.c +1 -1
@@ -577,7 +577,7 @@ void ip_forward_options(struct sk_buff *skb)ip_rt_get_source (&optptr[srrptr-1 ], skb, rt); optptr[2 ] = srrptr+4 ; }else if (net_ratelimit ()) -printk (KERN_CRIT "ip_forward(): Argh! Destination lost!\n" ); +pr_crit ("%s(): Argh! Destination lost!\n" , __func__);if (opt->ts_needaddr) { optptr = raw + opt->ts;ip_rt_get_source (&optptr[optptr[2 ]-9 ], skb, rt);
net/ipv4/ipcomp.c +4 -4
@@ -156,11 +156,11 @@ static const struct net_protocol ipcomp4_protocol = {static int __init ipcomp4_init (void ) {if (xfrm_register_type (&ipcomp_type,AF_INET ) <0 ) { -printk (KERN_INFO "ipcomp init: can't add xfrm type\n" ); +pr_info ("%s: can't add xfrm type\n" , __func__);return -EAGAIN ; }if (inet_add_protocol (&ipcomp4_protocol,IPPROTO_COMP ) <0 ) { -printk (KERN_INFO "ipcomp init: can't add protocol\n" ); +pr_info ("%s: can't add protocol\n" , __func__);xfrm_unregister_type (&ipcomp_type,AF_INET );return -EAGAIN ; }
@@ -170,9 +170,9 @@ static int __init ipcomp4_init(void) static void __exit ipcomp4_fini(void) {if (inet_del_protocol (&ipcomp4_protocol,IPPROTO_COMP ) <0 ) -printk (KERN_INFO "ip ipcomp close: can't remove protocol\n" ); +pr_info ("%s: can't remove protocol\n" , __func__);if (xfrm_unregister_type (&ipcomp_type,AF_INET ) <0 ) -printk (KERN_INFO "ip ipcomp close: can't remove xfrm type\n" ); +pr_info ("%s: can't remove xfrm type\n" , __func__); }module_init (ipcomp4_init);
net/ipv4/ipconfig.c +55 -55
277 lines not on this page · raw message
net/ipv4/ipip.c +2 -2
@@ -892,7 +892,7 @@ static int __init ipip_init(void) err =xfrm4_tunnel_register (&ipip_handler,AF_INET );if (err <0 ) {unregister_pernet_device (&ipip_net_ops); -printk (KERN_INFO "ipip init: can't register tunnel\n" ); +pr_info ("%s: can't register tunnel\n" , __func__); }return err; }
@@ -900,7 +900,7 @@ static int __init ipip_init(void) static void __exit ipip_fini(void) {if (xfrm4_tunnel_deregister (&ipip_handler,AF_INET )) -printk (KERN_INFO "ipip close: can't deregister tunnel\n" ); +pr_info ("%s: can't deregister tunnel\n" , __func__);unregister_pernet_device (&ipip_net_ops); }
net/ipv4/ipmr.c +2 -2
@@ -951,7 +951,7 @@ static int ipmr_cache_report(struct mr_table *mrt,rcu_read_unlock ();if (ret <0 ) {if (net_ratelimit ()) -printk (KERN_WARNING "mroute: pending queue full, dropping entries.\n" ); +pr_warn ("mroute: pending queue full, dropping entries\n" );kfree_skb (skb); }
@@ -2538,7 +2538,7 @@ int __init ip_mr_init(void) goto reg_notif_fail;#ifdef CONFIG_IP_PIMSM_V2 if (inet_add_protocol (&pim_protocol,IPPROTO_PIM ) <0 ) { -printk (KERN_ERR "ip_mr_init: can't add PIM protocol\n" ); +pr_err ("%s: can't add PIM protocol\n" , __func__); err = -EAGAIN ; goto add_proto_fail; }
net/ipv4/ping.c +9 -9
@@ -156,7 +156,7 @@ static struct sock *ping_v4_lookup(struct net *net, __be32 saddr, __be32 daddr,struct hlist_nulls_node *hnode;pr_debug ("try to find: num = %d, daddr = %pI4, dif = %d\n" , - (int )ident, &daddr, dif); + (int )ident, &daddr, dif);read_lock_bh (&ping_table.lock);ping_portaddr_for_each_entry (sk, hnode, hslot) {
@@ -229,7 +229,7 @@ static int ping_init_sock(struct sock *sk)static void ping_close (struct sock *sk,long timeout) {pr_debug ("ping_close(sk=%p,sk->num=%u)\n" , -inet_sk (sk),inet_sk (sk)->inet_num); +inet_sk (sk),inet_sk (sk)->inet_num);pr_debug ("isk->refcnt = %d\n" , sk->sk_refcnt.counter);sk_common_release (sk);
@@ -252,7 +252,7 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)return -EINVAL ;pr_debug ("ping_v4_bind(sk=%p,sa_addr=%08x,sa_port=%d)\n" , - sk, addr->sin_addr.s_addr,ntohs (addr->sin_port)); + sk, addr->sin_addr.s_addr,ntohs (addr->sin_port)); chk_addr_ret =inet_addr_type (sock_net (sk), addr->sin_addr.s_addr);if (addr->sin_addr.s_addr ==htonl (INADDR_ANY ))
@@ -280,9 +280,9 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) }pr_debug ("after bind(): num = %d, daddr = %pI4, dif = %d\n" , - (int )isk->inet_num, - &isk->inet_rcv_saddr, - (int )sk->sk_bound_dev_if); + (int )isk->inet_num, + &isk->inet_rcv_saddr, + (int )sk->sk_bound_dev_if); err =0 ;if (isk->inet_rcv_saddr)
@@ -335,7 +335,7 @@ void ping_err(struct sk_buff *skb, u32 info)return ;pr_debug ("ping_err(type=%04x,code=%04x,id=%04x,seq=%04x)\n" , type, - code,ntohs (icmph->un.echo.id),ntohs (icmph->un.echo.sequence)); + code,ntohs (icmph->un.echo.id),ntohs (icmph->un.echo.sequence)); sk =ping_v4_lookup (net, iph->daddr, iph->saddr,ntohs (icmph->un.echo.id), skb->dev->ifindex);
@@ -679,7 +679,7 @@ out:static int ping_queue_rcv_skb (struct sock *sk,struct sk_buff *skb) {pr_debug ("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n" , -inet_sk (sk),inet_sk (sk)->inet_num, skb); +inet_sk (sk),inet_sk (sk)->inet_num, skb);if (sock_queue_rcv_skb (sk, skb) <0 ) {kfree_skb (skb);pr_debug ("ping_queue_rcv_skb -> failed\n" );
@@ -705,7 +705,7 @@ void ping_rcv(struct sk_buff *skb)/* We assume the packet has already been checked by icmp_rcv */ pr_debug ("ping_rcv(skb=%p,id=%04x,seq=%04x)\n" , - skb,ntohs (icmph->un.echo.id),ntohs (icmph->un.echo.sequence)); + skb,ntohs (icmph->un.echo.id),ntohs (icmph->un.echo.sequence));/* Push ICMP header back */ skb_push (skb, skb->data - (u8 *)icmph);
net/ipv4/raw.c +2 -5
@@ -491,11 +491,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,if (msg->msg_namelen <sizeof (*usin)) goto out;if (usin->sin_family !=AF_INET ) { -static int complained; -if (!complained++) -printk (KERN_INFO "%s forgot to set AF_INET in " -"raw sendmsg. Fix it!\n" , - current->comm); +pr_info_once ("%s: %s forgot to set AF_INET. Fix it!\n" , + __func__, current->comm); err = -EAFNOSUPPORT ;if (usin->sin_family) goto out;
net/ipv4/route.c +18 -25
112 lines not on this page · raw message
net/ipv4/tcp.c +3 -4
@@ -1675,7 +1675,7 @@ do_prequeue:if (tp->ucopy.dma_cookie <0 ) { -printk (KERN_ALERT "dma_cookie < 0\n" ); +pr_alert ("dma_cookie < 0\n" );/* Exception. Bailout! */ if (!copied)
@@ -3311,9 +3311,8 @@ void __init tcp_init(void) sysctl_tcp_rmem[1 ] =87380 ; sysctl_tcp_rmem[2 ] =max (87380 , max_share); -printk (KERN_INFO "TCP: Hash tables configured " -"(established %u bind %u)\n" , - tcp_hashinfo.ehash_mask +1 , tcp_hashinfo.bhash_size); +pr_info ("TCP: Hash tables configured (established %u bind %u)\n" , + tcp_hashinfo.ehash_mask +1 , tcp_hashinfo.bhash_size);tcp_register_congestion_control (&tcp_reno);
net/ipv4/tcp_cong.c +3 -4
@@ -41,18 +41,17 @@ int tcp_register_congestion_control(struct tcp_congestion_ops *ca)/* all algorithms must implement ssthresh and cong_avoid ops */ if (!ca->ssthresh || !ca->cong_avoid) { -printk (KERN_ERR "TCP %s does not implement required ops\n" , - ca->name); +pr_err ("TCP %s does not implement required ops\n" , ca->name);return -EINVAL ; }spin_lock (&tcp_cong_list_lock);if (tcp_ca_find (ca->name)) { -printk (KERN_NOTICE "TCP %s already registered\n" , ca->name); +pr_notice ("TCP %s already registered\n" , ca->name); ret = -EEXIST ; }else {list_add_tail_rcu (&ca->list, &tcp_cong_list); -printk (KERN_INFO "TCP %s registered\n" , ca->name); +pr_info ("TCP %s registered\n" , ca->name); }spin_unlock (&tcp_cong_list_lock);
net/ipv4/tcp_input.c +4 -4
@@ -3867,9 +3867,9 @@ void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *o opt_rx->wscale_ok =1 ;if (snd_wscale >14 ) {if (net_ratelimit ()) -printk (KERN_INFO "tcp_parse_options: Illegal window " -"scaling value %d >14 received.\n" , - snd_wscale); +pr_info ("%s: Illegal window scaling value %d >14 received\n" , + __func__, + snd_wscale); snd_wscale =14 ; } opt_rx->snd_wscale = snd_wscale;
@@ -4191,7 +4191,7 @@ static void tcp_fin(struct sock *sk)/* Only TCP_LISTEN and TCP_CLOSE are left, in these * cases we should never reach this piece of code. */ -printk (KERN_ERR "%s: Impossible, sk->sk_state=%d\n" , +pr_err ("%s: Impossible, sk->sk_state=%d\n" , __func__, sk->sk_state);break ; }
net/ipv4/tcp_ipv4.c +4 -4
@@ -1227,10 +1227,10 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb)if (genhash ||memcmp (hash_location, newhash,16 ) !=0 ) {if (net_ratelimit ()) { -printk (KERN_INFO "MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n" , - &iph->saddr,ntohs (th->source), - &iph->daddr,ntohs (th->dest), - genhash ?" tcp_v4_calc_md5_hash failed" :"" ); +pr_info ("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n" , + &iph->saddr,ntohs (th->source), + &iph->daddr,ntohs (th->dest), + genhash ?" tcp_v4_calc_md5_hash failed" :"" ); }return 1 ; }
net/ipv4/tunnel4.c +4 -4
@@ -164,12 +164,12 @@ static const struct net_protocol tunnel64_protocol = {static int __init tunnel4_init (void ) {if (inet_add_protocol (&tunnel4_protocol,IPPROTO_IPIP )) { -printk (KERN_ERR "tunnel4 init: can't add protocol\n" ); +pr_err ("%s: can't add protocol\n" , __func__);return -EAGAIN ; }#if IS_ENABLED (CONFIG_IPV6 )if (inet_add_protocol (&tunnel64_protocol,IPPROTO_IPV6 )) { -printk (KERN_ERR "tunnel64 init: can't add protocol\n" ); +pr_err ("tunnel64 init: can't add protocol\n" );inet_del_protocol (&tunnel4_protocol,IPPROTO_IPIP );return -EAGAIN ; }
@@ -181,10 +181,10 @@ static void __exit tunnel4_fini(void) {#if IS_ENABLED (CONFIG_IPV6 )if (inet_del_protocol (&tunnel64_protocol,IPPROTO_IPV6 )) -printk (KERN_ERR "tunnel64 close: can't remove protocol\n" ); +pr_err ("tunnel64 close: can't remove protocol\n" );#endif if (inet_del_protocol (&tunnel4_protocol,IPPROTO_IPIP )) -printk (KERN_ERR "tunnel4 close: can't remove protocol\n" ); +pr_err ("tunnel4 close: can't remove protocol\n" ); }module_init (tunnel4_init);
net/ipv4/udplite.c +2 -2
@@ -129,11 +129,11 @@ void __init udplite4_register(void)inet_register_protosw (&udplite4_protosw);if (udplite4_proc_init ()) -printk (KERN_ERR "%s: Cannot register /proc!\n" , __func__); +pr_err ("%s: Cannot register /proc!\n" , __func__);return ; out_unregister_proto:proto_unregister (&udplite_prot); out_register_err: -printk (KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n" , __func__); +pr_crit ("%s: Cannot add UDP-Lite protocol\n" , __func__); }
net/ipv4/xfrm4_tunnel.c +8 -6
@@ -75,18 +75,18 @@ static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = {static int __init ipip_init (void ) {if (xfrm_register_type (&ipip_type,AF_INET ) <0 ) { -printk (KERN_INFO "ipip init: can't add xfrm type\n" ); +pr_info ("%s: can't add xfrm type\n" , __func__);return -EAGAIN ; }if (xfrm4_tunnel_register (&xfrm_tunnel_handler,AF_INET )) { -printk (KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n" ); +pr_info ("%s: can't add xfrm handler for AF_INET\n" , __func__);xfrm_unregister_type (&ipip_type,AF_INET );return -EAGAIN ; }#if IS_ENABLED (CONFIG_IPV6 )if (xfrm4_tunnel_register (&xfrm64_tunnel_handler,AF_INET6 )) { -printk (KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n" ); +pr_info ("%s: can't add xfrm handler for AF_INET6\n" , __func__);xfrm4_tunnel_deregister (&xfrm_tunnel_handler,AF_INET );xfrm_unregister_type (&ipip_type,AF_INET );return -EAGAIN ;
@@ -99,12 +99,14 @@ static void __exit ipip_fini(void) {#if IS_ENABLED (CONFIG_IPV6 )if (xfrm4_tunnel_deregister (&xfrm64_tunnel_handler,AF_INET6 )) -printk (KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n" ); +pr_info ("%s: can't remove xfrm handler for AF_INET6\n" , + __func__);#endif if (xfrm4_tunnel_deregister (&xfrm_tunnel_handler,AF_INET )) -printk (KERN_INFO "ipip close: can't remove xfrm handler for AF_INET\n" ); +pr_info ("%s: can't remove xfrm handler for AF_INET\n" , + __func__);if (xfrm_unregister_type (&ipip_type,AF_INET ) <0 ) -printk (KERN_INFO "ipip close: can't remove xfrm type\n" ); +pr_info ("%s: can't remove xfrm type\n" , __func__); }module_init (ipip_init);
Signature · 1 line
1.7.8.111.gad25c.dirty
From: Joe Perches <[email protected]>
Date: Sun, 11 Mar 2012 21:36:11 -0700
Quoted 14 lines
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
#definepr_fmt(fmt)"IPv4: " fmt.
to standardize the output messages.
Quoted 8 lines
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.oldSigned-off-by Joe Perches <[email protected]>
Applied, thanks a lot Joe.
PATCH 1/1 net: ipv4: Standardize prefixes for message logging
Add #define pr_fmt(fmt) as appropriate.
Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ".
Add KBUILD_MODNAME ": " to icmp and gre.
Remove embedded prefixes as appropriate.
Add missing "\n" to pr_info in gre.c.
--- include/net/udplite.h | 4 ++-- net/ipv4/af_inet.c | 2 ++ net/ipv4/ah4.c | 9 ++++++--- net/ipv4/esp4.c | 2 ++ net/ipv4/gre.c | 6 ++++-- net/ipv4/icmp.c | 6 ++++-- net/ipv4/ip_fragment.c | 8 +++++--- net/ipv4/ip_gre.c | 2 ++ net/ipv4/ip_input.c | 2 ++ net/ipv4/ip_options.c | 2 ++ net/ipv4/ipcomp.c | 1 + net/ipv4/route.c | 4 +++- net/ipv4/tcp.c | 11 +++++++---- net/ipv4/tcp_cong.c | 8 +++++--- net/ipv4/tcp_input.c | 2 ++ net/ipv4/tcp_ipv4.c | 6 +++--- net/ipv4/tcp_probe.c | 4 +++- net/ipv4/tcp_timer.c | 14 ++++++++------ net/ipv4/udp.c | 34 ++++++++++++++-------------------- net/ipv4/udplite.c | 3 +++ net/ipv4/xfrm4_tunnel.c | 2 ++ 21 files changed, 82 insertions(+), 50 deletions(-)
include/net/udplite.h +2 -2
@@ -40,7 +40,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)* checksum. UDP-Lite (like IPv6) mandates checksums, hence packets * with a zero checksum field are illegal. */ if (uh->check ==0 ) { -LIMIT_NETDEBUG (KERN_DEBUG "UDPLITE: zeroed checksum field\n" ); +LIMIT_NETDEBUG (KERN_DEBUG "UDPLite: zeroed checksum field\n" );return 1 ; }
@@ -52,7 +52,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)/* * Coverage length violates RFC 3828: log and discard silently. */ -LIMIT_NETDEBUG (KERN_DEBUG "UDPLITE: bad csum coverage %d/%d\n" , +LIMIT_NETDEBUG (KERN_DEBUG "UDPLite: bad csum coverage %d/%d\n" , cscov, skb->len);return 1 ;
net/ipv4/af_inet.c +2 -0
@@ -65,6 +65,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <linux/err.h> #include <linux/errno.h> #include <linux/types.h>
net/ipv4/ah4.c +6 -3
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) "IPsec: " fmt +#include <crypto/hash.h> #include <linux/err.h> #include <linux/module.h>
@@ -445,9 +447,10 @@ static int ah_init_state(struct xfrm_state *x)if (aalg_desc->uinfo.auth.icv_fullbits/8 !=crypto_ahash_digestsize (ahash)) { -pr_info ("AH: %s digestsize %u != %hu\n" , - x->aalg->alg_name,crypto_ahash_digestsize (ahash), - aalg_desc->uinfo.auth.icv_fullbits/8 ); +pr_info ("%s: %s digestsize %u != %hu\n" , + __func__, x->aalg->alg_name, +crypto_ahash_digestsize (ahash), + aalg_desc->uinfo.auth.icv_fullbits /8 ); goto error; }
net/ipv4/esp4.c +2 -0
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) "IPsec: " fmt +#include <crypto/aead.h> #include <crypto/authenc.h> #include <linux/err.h>
net/ipv4/gre.c +4 -2
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/kmod.h>
@@ -118,10 +120,10 @@ static const struct net_protocol net_gre_protocol = {static int __init gre_init (void ) { -pr_info ("GRE over IPv4 demultiplexor driver" ); +pr_info ("GRE over IPv4 demultiplexor driver\n" );if (inet_add_protocol (&net_gre_protocol,IPPROTO_GRE ) <0 ) { -pr_err ("gre: can't add protocol\n" ); +pr_err ("can't add protocol\n" );return -EAGAIN ; }
net/ipv4/icmp.c +4 -2
@@ -62,6 +62,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/types.h> #include <linux/jiffies.h>
@@ -670,7 +672,7 @@ static void icmp_unreach(struct sk_buff *skb)break ;case ICMP_FRAG_NEEDED :if (ipv4_config.no_pmtu_disc) { -LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: fragmentation needed and DF set\n" , + LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"), &iph->daddr); }else { info = ip_rt_frag_needed(net, iph,
@@ -681,7 +683,7 @@ static void icmp_unreach(struct sk_buff *skb) }break ;case ICMP_SR_FAILED : -LIMIT_NETDEBUG (KERN_INFO "ICMP: %pI4: Source Route Failed\n" , + LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: Source Route Failed\n"), &iph->daddr);break ;default :
net/ipv4/ip_fragment.c +5 -3
@@ -20,6 +20,8 @@* Patrick McHardy : LRU queue of frag heads for evictor. */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <linux/compiler.h> #include <linux/module.h> #include <linux/types.h>
@@ -299,7 +301,7 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user) return container_of(q, struct ipq, q); out_nomem: -LIMIT_NETDEBUG (KERN_ERR "ip_frag_create: no memory left !\n" ); + LIMIT_NETDEBUG(KERN_ERR pr_fmt("ip_frag_create: no memory left !\n"));return NULL ; }
@@ -637,8 +639,8 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,return 0 ; out_nomem: -LIMIT_NETDEBUG (KERN_ERR "IP: queue_glue: no memory for gluing " -"queue %p\n" , qp); + LIMIT_NETDEBUG(KERN_ERR pr_fmt("queue_glue: no memory for gluing queue %p\n"), + qp); err = -ENOMEM ; goto out_fail; out_oversize:
net/ipv4/ip_gre.c +2 -0
@@ -10,6 +10,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/capability.h> #include <linux/module.h> #include <linux/types.h>
net/ipv4/ip_input.c +2 -0
@@ -113,6 +113,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <asm/system.h> #include <linux/module.h> #include <linux/types.h>
net/ipv4/ip_options.c +2 -0
@@ -9,6 +9,8 @@* */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <linux/capability.h> #include <linux/module.h> #include <linux/slab.h>
net/ipv4/ipcomp.c +1 -0
@@ -13,6 +13,7 @@* - Compression stats. * - Adaptive compression. */ +#include <linux/module.h> #include <linux/err.h> #include <linux/rtnetlink.h>
net/ipv4/route.c +3 -1
@@ -62,6 +62,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) "IPv4: " fmt +#include <linux/module.h> #include <asm/uaccess.h> #include <asm/system.h>
@@ -1298,7 +1300,7 @@ restart: }if (net_ratelimit ()) -pr_warn ("ipv4: Neighbour table overflow\n" ); +pr_warn ("Neighbour table overflow\n" );rt_drop (rt);return ERR_PTR (-ENOBUFS ); }
net/ipv4/tcp.c +7 -4
@@ -245,6 +245,8 @@* TCP_CLOSE socket is finished */ +#define pr_fmt (fmt) "TCP: " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/types.h>
@@ -1675,7 +1677,8 @@ do_prequeue:if (tp->ucopy.dma_cookie <0 ) { -pr_alert ("dma_cookie < 0\n" ); +pr_alert ("%s: dma_cookie < 0\n" , + __func__);/* Exception. Bailout! */ if (!copied)
@@ -1884,9 +1887,9 @@ bool tcp_check_oom(struct sock *sk, int shift) out_of_socket_memory =tcp_out_of_memory (sk);if (too_many_orphans &&net_ratelimit ()) -pr_info ("TCP: too many orphaned sockets\n" ); +pr_info ("too many orphaned sockets\n" );if (out_of_socket_memory &&net_ratelimit ()) -pr_info ("TCP: out of memory -- consider tuning tcp_mem\n" ); +pr_info ("out of memory -- consider tuning tcp_mem\n" );return too_many_orphans || out_of_socket_memory; }
@@ -3311,7 +3314,7 @@ void __init tcp_init(void) sysctl_tcp_rmem[1 ] =87380 ; sysctl_tcp_rmem[2 ] =max (87380 , max_share); -pr_info ("TCP: Hash tables configured (established %u bind %u)\n" , +pr_info ("Hash tables configured (established %u bind %u)\n" , tcp_hashinfo.ehash_mask +1 , tcp_hashinfo.bhash_size);tcp_register_congestion_control (&tcp_reno);
net/ipv4/tcp_cong.c +5 -3
@@ -6,6 +6,8 @@* Copyright (C) 2005 Stephen Hemminger <[email protected]> */ +#define pr_fmt (fmt) "TCP: " fmt +#include <linux/module.h> #include <linux/mm.h> #include <linux/types.h>
@@ -41,17 +43,17 @@ int tcp_register_congestion_control(struct tcp_congestion_ops *ca)/* all algorithms must implement ssthresh and cong_avoid ops */ if (!ca->ssthresh || !ca->cong_avoid) { -pr_err ("TCP %s does not implement required ops\n" , ca->name); +pr_err ("%s does not implement required ops\n" , ca->name);return -EINVAL ; }spin_lock (&tcp_cong_list_lock);if (tcp_ca_find (ca->name)) { -pr_notice ("TCP %s already registered\n" , ca->name); +pr_notice ("%s already registered\n" , ca->name); ret = -EEXIST ; }else {list_add_tail_rcu (&ca->list, &tcp_cong_list); -pr_info ("TCP %s registered\n" , ca->name); +pr_info ("%s registered\n" , ca->name); }spin_unlock (&tcp_cong_list_lock);
net/ipv4/tcp_input.c +2 -0
@@ -61,6 +61,8 @@* Pasi Sarolahti: F-RTO for dealing with spurious RTOs */ +#define pr_fmt (fmt) "TCP: " fmt +#include <linux/mm.h> #include <linux/slab.h> #include <linux/module.h>
net/ipv4/tcp_ipv4.c +3 -3
@@ -50,6 +50,7 @@* a single port at the same time. */ +#define pr_fmt (fmt) "TCP: " fmt#include <linux/bottom_half.h> #include <linux/types.h>
@@ -876,8 +877,7 @@ int tcp_syn_flood_action(struct sock *sk, lopt =inet_csk (sk)->icsk_accept_queue.listen_opt;if (!lopt->synflood_warned) { lopt->synflood_warned =1 ; -pr_info ("%s: Possible SYN flooding on port %d. %s. " -" Check SNMP counters.\n" , +pr_info ("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n" , proto,ntohs (tcp_hdr (skb)->dest), msg); }return want_cookie;
@@ -1399,7 +1399,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)* to destinations, already remembered * to the moment of synflood. */ -LIMIT_NETDEBUG (KERN_DEBUG "TCP: drop open request from %pI4/%u\n" , + LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("drop open request from %pI4/%u\n"), &saddr, ntohs(tcp_hdr(skb)->source)); goto drop_and_release; }
net/ipv4/tcp_probe.c +3 -1
@@ -18,6 +18,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/kprobes.h> #include <linux/socket.h>
@@ -239,7 +241,7 @@ static __init int tcpprobe_init(void)if (ret) goto err1; -pr_info ("TCP probe registered (port=%d) bufsize=%u\n" , port, bufsize); +pr_info ("probe registered (port=%d) bufsize=%u\n" , port, bufsize);return 0 ; err1:proc_net_remove (&init_net, procname);
net/ipv4/tcp_timer.c +8 -6
@@ -333,16 +333,18 @@ void tcp_retransmit_timer(struct sock *sk)*/ struct inet_sock *inet =inet_sk (sk);if (sk->sk_family ==AF_INET ) { -LIMIT_NETDEBUG (KERN_DEBUG "TCP: Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n" , - &inet->inet_daddr,ntohs (inet->inet_dport), - inet->inet_num, tp->snd_una, tp->snd_nxt); + LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n"), + &inet->inet_daddr, +ntohs (inet->inet_dport), inet->inet_num, + tp->snd_una, tp->snd_nxt); }#if IS_ENABLED (CONFIG_IPV6 ) else if (sk->sk_family == AF_INET6) {struct ipv6_pinfo *np =inet6_sk (sk); -LIMIT_NETDEBUG (KERN_DEBUG "TCP: Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n" , - &np->daddr,ntohs (inet->inet_dport), - inet->inet_num, tp->snd_una, tp->snd_nxt); + LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n"), + &np->daddr, +ntohs (inet->inet_dport), inet->inet_num, + tp->snd_una, tp->snd_nxt); }#endif if (tcp_time_stamp - tp->rcv_tstamp >TCP_RTO_MAX ) {
net/ipv4/udp.c +14 -20
@@ -77,6 +77,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) "UDP: " fmt +#include <asm/system.h> #include <asm/uaccess.h> #include <asm/ioctls.h>
@@ -975,7 +977,7 @@ back_from_confirm:/* ... which is an evident application bug. --ANK */ release_sock (sk); -LIMIT_NETDEBUG (KERN_DEBUG "udp cork app bug 2\n" ); + LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("cork app bug 2\n")); err = -EINVAL ; goto out; }
@@ -1054,7 +1056,7 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,if (unlikely (!up->pending)) {release_sock (sk); -LIMIT_NETDEBUG (KERN_DEBUG "udp cork app bug 3\n" ); + LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("udp cork app bug 3\n"));return -EINVAL ; }
@@ -1447,9 +1449,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)* provided by the application." */ if (up->pcrlen ==0 ) {/* full coverage was set */ -LIMIT_NETDEBUG (KERN_WARNING "UDPLITE: partial coverage " -"%d while full coverage %d requested\n" , -UDP_SKB_CB (skb)->cscov, skb->len); +LIMIT_NETDEBUG (KERN_WARNING "UDPLite: partial coverage %d while full coverage %d requested\n" , +UDP_SKB_CB (skb)->cscov, skb->len); goto drop; }/* The next case involves violating the min. coverage requested
@@ -1459,9 +1460,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)* Therefore the above ...()->partial_cov statement is essential. */ if (UDP_SKB_CB (skb)->cscov < up->pcrlen) { -LIMIT_NETDEBUG (KERN_WARNING -"UDPLITE: coverage %d too small, need min %d\n" , -UDP_SKB_CB (skb)->cscov, up->pcrlen); +LIMIT_NETDEBUG (KERN_WARNING "UDPLite: coverage %d too small, need min %d\n" , +UDP_SKB_CB (skb)->cscov, up->pcrlen); goto drop; } }
@@ -1689,13 +1689,10 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, short_packet:LIMIT_NETDEBUG (KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n" , - proto ==IPPROTO_UDPLITE ?"-Lite" :"" , - &saddr, -ntohs (uh->source), - ulen, - skb->len, - &daddr, -ntohs (uh->dest)); + proto ==IPPROTO_UDPLITE ?"Lite" :"" , + &saddr,ntohs (uh->source), + ulen, skb->len, + &daddr,ntohs (uh->dest)); goto drop; csum_error:
@@ -1704,11 +1701,8 @@ csum_error:* the network is concerned, anyway) as per 4.1.3.4 (MUST). */ LIMIT_NETDEBUG (KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n" , - proto ==IPPROTO_UDPLITE ?"-Lite" :"" , - &saddr, -ntohs (uh->source), - &daddr, -ntohs (uh->dest), + proto ==IPPROTO_UDPLITE ?"Lite" :"" , + &saddr,ntohs (uh->source), &daddr,ntohs (uh->dest), ulen); drop:UDP_INC_STATS_BH (net,UDP_MIB_INERRORS , proto ==IPPROTO_UDPLITE );
net/ipv4/udplite.c +3 -0
@@ -10,6 +10,9 @@* as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#define pr_fmt (fmt) "UDPLite: " fmt +#include <linux/export.h> #include "udp_impl.h"
net/ipv4/xfrm4_tunnel.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2003 David S. Miller ([email protected]) */ +#define pr_fmt (fmt) "IPsec: " fmt +#include <linux/skbuff.h> #include <linux/module.h> #include <linux/mutex.h>
Signature · 1 line
1.7.8.111.gad25c.dirty
David Miller
maintainerRe: [PATCH net-next] net: ipv4: Standardize prefixes for message logging
From: Joe Perches <[email protected]>
Date: Mon, 12 Mar 2012 10:03:32 -0700
Quoted 6 lines
Add #define
pr_fmt(fmt)as appropriate.Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ".
Quoted 6 lines
Add
KBUILD_MODNAME": " to icmp and gre.
Remove embedded prefixes as appropriate.Add missing "\n" to
pr_infoingre.c.Signed-off-by Joe Perches <[email protected]>
Looks good, and applied, but I left out this hunk:
net/ipv4/ipcomp.c line 19
Quoted 12 lines
net/ipv4/ipcomp.c +1
-0@@ -13,6 +13,7 @@* - Compression stats. * - Adaptive compression. */ +#include <linux/module.h> #include <linux/err.h> #include <linux/rtnetlink.h>
As it seemed accidental, if not gratuitous.
Re: [PATCH net-next] net: ipv4: Standardize prefixes for message logging
Quoted 6 lines · David Miller
From: Joe Perches <[email protected]>
Date: Mon, 12 Mar 2012 10:03:32 -0700Quoted 4 lines
Add #define
pr_fmt(fmt)as appropriate.
Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ".
[]
Quoted 1 line
Looks good, and applied,
OK. I'll submit a similar change for net/ipv6 in awhile.
Quoted 16 lines
but I left out this hunk:
net/ipv4/ipcomp.c line 19
Quoted 12 lines
net/ipv4/ipcomp.c +1
-0@@ -13,6 +13,7 @@* - Compression stats. * - Adaptive compression. */ +#include <linux/module.h> #include <linux/err.h> #include <linux/rtnetlink.h> As it seemed accidental, if not gratuitous.
It wasn't accidental, though I could have mentioned it in the changelog. Most files have a blank line between an initial block commment and the first #include.
I just do that by habit when looking if a file could benefit from a #define pr_fmt.
I added a similar blank line to udplite.c, but there I also added pr_fmt.
cheers, Joe
Re: [PATCH net-next] net: ipv4: Standardize prefixes for message logging
Quoted 10 lines · Joe Perches
Quoted 6 lines · David Miller
From: Joe Perches <[email protected]>
Date: Mon, 12 Mar 2012 10:03:32 -0700Quoted 4 lines
Add #define
pr_fmt(fmt)as appropriate.
Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ".[]
Quoted 1 line
Looks good, and applied,
OK. I'll submit a similar change for net/ipv6 in awhile.
Would you still take a similar IPv6: prefix
change for net-next or should I wait until
the next release cycle?
David Miller
maintainerRe: [PATCH net-next] net: ipv4: Standardize prefixes for message logging
From: Joe Perches <[email protected]>
Date: Mon, 19 Mar 2012 14:00:04 -0700
Quoted 8 lines · Joe Perches
Quoted 7 lines · David Miller
Quoted 6 lines
From: Joe Perches <[email protected]>
Date: Mon, 12 Mar 2012 10:03:32 -0700Quoted 4 lines
Add #define
pr_fmt(fmt)as appropriate.
Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ".
Quoted 7 lines
Quoted 3 lines
[]
Quoted 1 line
Looks good, and applied,
OK. I'll submit a similar change for net/ipv6 in awhile.
Would you still take a similar IPv6: prefix
change for net-next or should I wait until
the next release cycle?
Sure why not, everyone else is being a complete idiot and submitting all of their shit at the merge window openning.
I am backlogged every single time the merge window opens up, why do you people wait until the last possible minute to submit things? Are you all too selfish or too stupid to care?
Every single one of you know it's coming, you see several -rc releases go out.
The merge window isn't a trigger to "get it done and submitted right now."
Instead, it really means "too late."
Re: [PATCH net-next] net: ipv4: Standardize prefixes for message logging
Quoted 2 lines · David Miller
From: Joe Perches <[email protected]>
Date: Mon, 19 Mar 2012 14:00:04 -0700
[]
Quoted 4 lines
Quoted 3 lines
Would you still take a similar IPv6: prefix
change for net-next or should I wait until
the next release cycle?Sure why not,
[]
Quoted 1 line
Instead, it really means "too late."
No worries, I'll set a good example instead.