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

Configure Feed

Select the types of activity you want to include in your feed.

[NET]: skbuff: remove old NET_CALLER macro

Here is a revised alternative that uses BUG_ON/WARN_ON
(as suggested by Herbert Xu) to eliminate NET_CALLER.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
9c2b3328 98f245e7

+5 -16
-6
include/linux/skbuff.h
··· 83 83 * Any questions? No questions, good. --ANK 84 84 */ 85 85 86 - #ifdef __i386__ 87 - #define NET_CALLER(arg) (*(((void **)&arg) - 1)) 88 - #else 89 - #define NET_CALLER(arg) __builtin_return_address(0) 90 - #endif 91 - 92 86 struct net_device; 93 87 94 88 #ifdef CONFIG_NETFILTER
+3 -9
net/core/skbuff.c
··· 276 276 277 277 void __kfree_skb(struct sk_buff *skb) 278 278 { 279 - if (skb->list) { 280 - printk(KERN_WARNING "Warning: kfree_skb passed an skb still " 281 - "on a list (from %p).\n", NET_CALLER(skb)); 282 - BUG(); 283 - } 279 + BUG_ON(skb->list != NULL); 284 280 285 281 dst_release(skb->dst); 286 282 #ifdef CONFIG_XFRM 287 283 secpath_put(skb->sp); 288 284 #endif 289 - if(skb->destructor) { 290 - if (in_irq()) 291 - printk(KERN_WARNING "Warning: kfree_skb on " 292 - "hard IRQ %p\n", NET_CALLER(skb)); 285 + if (skb->destructor) { 286 + WARN_ON(in_irq()); 293 287 skb->destructor(skb); 294 288 } 295 289 #ifdef CONFIG_NETFILTER
+2 -1
net/ipv4/route.c
··· 1048 1048 return; 1049 1049 } 1050 1050 } else 1051 - printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", NET_CALLER(iph)); 1051 + printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", 1052 + __builtin_return_address(0)); 1052 1053 1053 1054 ip_select_fb_ident(iph); 1054 1055 }