Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Herbert Xu
On Thu, Feb 23, 2006 at 12:22:31PM +0100, J?rn Engel wrote: > > Should I merge the two patches into one and resend? Sounds good. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.ap

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Jörn Engel
On Thu, 23 February 2006 03:11:12 -0800, David S. Miller wrote: > > > Now there's a good idea. After all, the great majority of callers > > of kfree_skb expect to free the skb. Dave, what do you think? > > Absolutely. Should I merge the two patches into one and resend? Jörn -- If you're wil

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread David S. Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Thu, 23 Feb 2006 21:55:43 +1100 > Now there's a good idea. After all, the great majority of callers > of kfree_skb expect to free the skb. Dave, what do you think? Absolutely. - To unsubscribe from this list: send the line "unsubscribe netdev" in the b

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Herbert Xu
On Thu, Feb 23, 2006 at 11:50:41AM +0100, J?rn Engel wrote: > > For my kernel, there would be 92 removals if the condition at the > price of 135 bytes of extra object code. Some of the removals would > be in modules, so the numbers are not exactly fair. IMHO source saving is cheap while binary b

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Jörn Engel
On Thu, 23 February 2006 21:10:37 +1100, Herbert Xu wrote: > On Thu, Feb 23, 2006 at 10:54:46AM +0100, J?rn Engel wrote: > > > > Wrt. the binary, you have a point. For source code, my patch does not > > any new bloat and allows removal of the existing. Lemme do a quick > > Well I just did a gre

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Herbert Xu
On Thu, Feb 23, 2006 at 10:54:46AM +0100, J?rn Engel wrote: > > Wrt. the binary, you have a point. For source code, my patch does not > any new bloat and allows removal of the existing. Lemme do a quick Well I just did a grep in net/*/*.c and it seems that the number of calls to kfree_skb prece

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Jörn Engel
On Thu, 23 February 2006 19:28:49 +1100, Herbert Xu wrote: > On Thu, Feb 23, 2006 at 07:53:36AM +0100, J?rn Engel wrote: > > > > How is that argument special for kfree_skb? Both libc free and kfree > > ignore NULL arguments and do so for good reasons. > > Well with kfree there is actually a slig

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-23 Thread Herbert Xu
On Thu, Feb 23, 2006 at 07:53:36AM +0100, J?rn Engel wrote: > > How is that argument special for kfree_skb? Both libc free and kfree > ignore NULL arguments and do so for good reasons. Well with kfree there is actually a slight gain in that you are doing the check in one place. kfree_skb on the

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Jörn Engel
On Thu, 23 February 2006 12:17:14 +1100, Herbert Xu wrote: > J?rn Engel <[EMAIL PROTECTED]> wrote: > > Fairly trivial. The extra conditional should get optimized away with > > current code. But it also allows to walk through network drivers and > > get rid of the permanent > >if (skb) > >

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Herbert Xu
J?rn Engel <[EMAIL PROTECTED]> wrote: > Fairly trivial. The extra conditional should get optimized away with > current code. But it also allows to walk through network drivers and > get rid of the permanent >if (skb) >kfree(skb); > conditionals. This is bad because it hid

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Michael Buesch
On Wednesday 22 February 2006 18:52, you wrote: > On Wed, 22 February 2006 18:44:33 +0100, Michael Buesch wrote: > > On Wednesday 22 February 2006 09:26, you wrote: > > > Fairly trivial. The extra conditional should get optimized away with > > > current code. But it also allows to walk through ne

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Jörn Engel
On Wed, 22 February 2006 18:44:33 +0100, Michael Buesch wrote: > On Wednesday 22 February 2006 09:26, you wrote: > > Fairly trivial. The extra conditional should get optimized away with > > current code. But it also allows to walk through network drivers and > > get rid of the permanent > > i

Re: [PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Michael Buesch
On Wednesday 22 February 2006 09:26, you wrote: > Fairly trivial. The extra conditional should get optimized away with > current code. But it also allows to walk through network drivers and > get rid of the permanent > if (skb) > kfree(skb); > conditionals. I am all for this

[PATCH] Allow kfree_skb to be called with a NULL argument

2006-02-22 Thread Jörn Engel
Fairly trivial. The extra conditional should get optimized away with current code. But it also allows to walk through network drivers and get rid of the permanent if (skb) kfree(skb); conditionals. Jörn -- Unless something dramatically changes, by 2015 we'll be largely