netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] skbuff: remove old NET_CALLER macro
Date: Tue, 19 Apr 2005 17:44:58 +1000	[thread overview]
Message-ID: <20050419174458.0ae804f3@localhost.localdomain> (raw)

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

             reply	other threads:[~2005-04-19  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19  7:44 Stephen Hemminger [this message]
2005-04-19  8:04 ` [PATCH] skbuff: remove old NET_CALLER macro Herbert Xu
2005-04-19 18:35   ` David S. Miller
     [not found]     ` <20050420100457.2444512d@localhost.localdomain>
2005-04-20  0:15       ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419174458.0ae804f3@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).