[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>
This commit is contained in:
Stephen Hemminger 2005-04-19 22:39:42 -07:00 committed by David S. Miller
parent 98f245e797
commit 9c2b3328f7
3 changed files with 5 additions and 16 deletions

View File

@ -83,12 +83,6 @@
* Any questions? No questions, good. --ANK * 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; struct net_device;
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER

View File

@ -276,20 +276,14 @@ void kfree_skbmem(struct sk_buff *skb)
void __kfree_skb(struct sk_buff *skb) void __kfree_skb(struct sk_buff *skb)
{ {
if (skb->list) { BUG_ON(skb->list != NULL);
printk(KERN_WARNING "Warning: kfree_skb passed an skb still "
"on a list (from %p).\n", NET_CALLER(skb));
BUG();
}
dst_release(skb->dst); dst_release(skb->dst);
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
secpath_put(skb->sp); secpath_put(skb->sp);
#endif #endif
if(skb->destructor) { if (skb->destructor) {
if (in_irq()) WARN_ON(in_irq());
printk(KERN_WARNING "Warning: kfree_skb on "
"hard IRQ %p\n", NET_CALLER(skb));
skb->destructor(skb); skb->destructor(skb);
} }
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER

View File

@ -1048,7 +1048,8 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more)
return; return;
} }
} else } 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); ip_select_fb_ident(iph);
} }