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 network drivers and > > > get rid of the permanent > > > if (skb) > > > kfree(skb); > > > conditionals. > > > > I am all for this change, but I am wondering how this is > > possible to get optimized away... The compiler can't know > > if a skb variable is NULL or not, at runtime. > > if (skb) { > /* the compiler can know that skb is non-NULL now */ > kfree_skb(skb); > } > > I must admit that I haven't tested whether gcc will optimize it away, > though.
Ah, well. I was talking about the //foo kfree_skb(skb); //bar case, which has an additional if added, now. But that is OK. I like it. I recently had a bug in bcm43xx, because I assumed kfree_skb can take a NULL pointer, as any free function can. -- Greetings Michael.
pgpuDeoowNVNA.pgp
Description: PGP signature