On Thu, 23 February 2006 12:48:01 -0800, David S. Miller wrote:
>
> If you wish to contribute to a software project, you should adhere to
> the coding style and conventions of that project when submitting
> changes. It doesn't matter what the reasons are for those
> conventions, you should follow them until the projects decides to
> change them.
Agreed.
> If you wish to discuss the merits of putting extern there or not in
> function declarations, you can start a thread about that and make
> proposals on linux-kernel.
Not really. According to my limited understanding of C, the presence
or absence of extern shouldn't make a difference either way. If this
understanding if correct and people simply prefer to have the extern,
that's perfectly fine with me. But if it does indeed make a
difference, I'd like to learn something new.
> So place add extern here, thanks a lot.
Done. Sorry about that.
Jörn
--
The cost of changing business rules is much more expensive for software
than for a secretaty.
-- unknown
o Uninline kfree_skb, which saves some 15k of object code on my notebook.
o Allow kfree_skb to be called with a NULL argument.
Subsequent patches can remove conditional from drivers and further
reduce source and object size.
Signed-off-by: Jörn Engel <[EMAIL PROTECTED]>
---
include/linux/skbuff.h | 17 +----------------
net/core/skbuff.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 16 deletions(-)
--- kfree_skb/include/linux/skbuff.h~kfree_skb_uninline_null 2006-02-23
13:35:05.000000000 +0100
+++ kfree_skb/include/linux/skbuff.h 2006-02-23 13:36:23.000000000 +0100
@@ -306,6 +306,7 @@ struct sk_buff {
#include <asm/system.h>
+extern void kfree_skb(struct sk_buff *skb);
extern void __kfree_skb(struct sk_buff *skb);
extern struct sk_buff *__alloc_skb(unsigned int size,
gfp_t priority, int fclone);
@@ -406,22 +407,6 @@ static inline struct sk_buff *skb_get(st
*/
/**
- * kfree_skb - free an sk_buff
- * @skb: buffer to free
- *
- * Drop a reference to the buffer and free it if the usage count has
- * hit zero.
- */
-static inline void kfree_skb(struct sk_buff *skb)
-{
- if (likely(atomic_read(&skb->users) == 1))
- smp_rmb();
- else if (likely(!atomic_dec_and_test(&skb->users)))
- return;
- __kfree_skb(skb);
-}
-
-/**
* skb_cloned - is the buffer a clone
* @skb: buffer to check
*
--- kfree_skb/net/core/skbuff.c~kfree_skb_uninline_null 2006-02-23
13:35:05.000000000 +0100
+++ kfree_skb/net/core/skbuff.c 2006-02-23 13:37:01.000000000 +0100
@@ -355,6 +355,24 @@ void __kfree_skb(struct sk_buff *skb)
}
/**
+ * kfree_skb - free an sk_buff
+ * @skb: buffer to free
+ *
+ * Drop a reference to the buffer and free it if the usage count has
+ * hit zero.
+ */
+void kfree_skb(struct sk_buff *skb)
+{
+ if (unlikely(!skb))
+ return;
+ if (likely(atomic_read(&skb->users) == 1))
+ smp_rmb();
+ else if (likely(!atomic_dec_and_test(&skb->users)))
+ return;
+ __kfree_skb(skb);
+}
+
+/**
* skb_clone - duplicate an sk_buff
* @skb: buffer to clone
* @gfp_mask: allocation priority
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html