[NET]: skbuff: remove old NET_CALLER macro
authorStephen Hemminger <shemminger@osdl.org>
Wed, 20 Apr 2005 05:39:42 +0000 (22:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2005 05:39:42 +0000 (22:39 -0700)
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>
include/linux/skbuff.h
net/core/skbuff.c
net/ipv4/route.c

index 9f2d75e4f087642d2af265e0b477d0db53ee56f1..22b701819619cd6403b834284deecdbdcfb553d4 100644 (file)
  *     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
index c96559574a3fc281d0642846eb1bc49206eabcb4..1b64817d7de6b8a1fc1173aa2b2ed898c08a6033 100644 (file)
@@ -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
index 9f91a116d91926df3ba936a80f020a6ab1084d2b..bb90a0c3a91eb52020d0db0e8b4f94d30e02d596 100644 (file)
@@ -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);
 }