Re: [PATCH] skbuff: remove pointless conditional before kfree_skb()

David Miller
2012-08-30T17:39:31Z

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 28 Aug 2012 20:38:48 -0700

> On Tue, 2012-08-28 at 17:39 -0300, Flavio Leitner wrote:
>
>> Ok, and what if kfree_skb() becomes a macro that first checks
>> if the skb is NULL and if not, call the _kfree_skb() to
>> continue as before?
>>
>> #define kfree_skb(skb) \
>> if (skb) \
>> _kfree_skb(skb) \
>
> Then its adding a conditional test on each call site and increase
> kernel code size.
>
> So if you plan submitting such patch, please keep the whole thing out of
> line.

I'm tossing this entire series.

Each and every case must be investigated individually and:

1) If the check is kept, a big comment explaining why is added
to the code.

2) If the check is removed, a big piece of explanatory text is
added to the commit log message explaining everything in
full detail.