diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-04-20 09:39:42 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-04-20 09:39:42 +0400 |
commit | 9c2b3328f74800bb370d08bb3a4255d5fe833e94 (patch) | |
tree | 9d3092a44b592a091c4818a20bd678d1191f7a88 | |
parent | 98f245e797a01611d6734c7d192240f1361439d3 (diff) | |
download | linux-9c2b3328f74800bb370d08bb3a4255d5fe833e94.tar.xz |
[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>
-rw-r--r-- | include/linux/skbuff.h | 6 | ||||
-rw-r--r-- | net/core/skbuff.c | 12 | ||||
-rw-r--r-- | net/ipv4/route.c | 3 |
3 files changed, 5 insertions, 16 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 9f2d75e4f087..22b701819619 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -83,12 +83,6 @@ * Any questions? No questions, good. --ANK */ -#ifdef __i386__ -#define NET_CALLER(arg) (*(((void **)&arg) - 1)) -#else -#define NET_CALLER(arg) __builtin_return_address(0) -#endif - struct net_device; #ifdef CONFIG_NETFILTER diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c96559574a3f..1b64817d7de6 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -276,20 +276,14 @@ void kfree_skbmem(struct sk_buff *skb) void __kfree_skb(struct sk_buff *skb) { - if (skb->list) { - printk(KERN_WARNING "Warning: kfree_skb passed an skb still " - "on a list (from %p).\n", NET_CALLER(skb)); - BUG(); - } + BUG_ON(skb->list != NULL); dst_release(skb->dst); #ifdef CONFIG_XFRM secpath_put(skb->sp); #endif - if(skb->destructor) { - if (in_irq()) - printk(KERN_WARNING "Warning: kfree_skb on " - "hard IRQ %p\n", NET_CALLER(skb)); + if (skb->destructor) { + WARN_ON(in_irq()); skb->destructor(skb); } #ifdef CONFIG_NETFILTER diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 9f91a116d919..bb90a0c3a91e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1048,7 +1048,8 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more) return; } } else - printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", NET_CALLER(iph)); + printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", + __builtin_return_address(0)); ip_select_fb_ident(iph); } |