netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] skbuff: remove old NET_CALLER macro
@ 2005-04-19  7:44 Stephen Hemminger
  2005-04-19  8:04 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2005-04-19  7:44 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Kill NET_CALLER it causes warnings from sparse and is no longer
necessary.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -urNp -X dontdiff ck-2.6.11/include/linux/skbuff.h net-2.6.11/include/linux/skbuff.h
--- ck-2.6.11/include/linux/skbuff.h	2005-03-02 18:38:38.000000000 +1100
+++ net-2.6.11/include/linux/skbuff.h	2005-04-19 16:59:31.000000000 +1000
@@ -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 -urNp -X dontdiff ck-2.6.11/net/core/skbuff.c net-2.6.11/net/core/skbuff.c
--- ck-2.6.11/net/core/skbuff.c	2005-04-19 17:07:13.000000000 +1000
+++ net-2.6.11/net/core/skbuff.c	2005-04-19 17:31:38.000000000 +1000
@@ -275,9 +275,10 @@ void kfree_skbmem(struct sk_buff *skb)
 
 void __kfree_skb(struct sk_buff *skb)
 {
-	if (skb->list) {
+	if (unlikely(skb->list)) {
 	 	printk(KERN_WARNING "Warning: kfree_skb passed an skb still "
-		       "on a list (from %p).\n", NET_CALLER(skb));
+		       "on a list (from %p).\n", 
+			__builtin_return_address(0));
 		BUG();
 	}
 
@@ -285,10 +286,11 @@ void __kfree_skb(struct sk_buff *skb)
 #ifdef CONFIG_XFRM
 	secpath_put(skb->sp);
 #endif
-	if(skb->destructor) {
+	if (unlikely(skb->destructor)) {
 		if (in_irq())
 			printk(KERN_WARNING "Warning: kfree_skb on "
-					    "hard IRQ %p\n", NET_CALLER(skb));
+					    "hard IRQ %p\n",
+			__builtin_return_address(0));
 		skb->destructor(skb);
 	}
 #ifdef CONFIG_NETFILTER

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-20  0:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-19  7:44 [PATCH] skbuff: remove old NET_CALLER macro Stephen Hemminger
2005-04-19  8:04 ` Herbert Xu
2005-04-19 18:35   ` David S. Miller
     [not found]     ` <20050420100457.2444512d@localhost.localdomain>
2005-04-20  0:15       ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).