Messages in this thread | | | Subject | Re: [PATCH net-next 02/13] driver: net: remove unnecessary skb NULL check before calling dev_kfree_skb_irq | From | Johannes Berg <> | Date | Mon, 18 Nov 2013 20:37:11 +0100 |
| |
Please don't top-post. You're making a lot of obvious mistakes, to the likely effect that soon enough people won't even read your email.
> Did you have a chance to look at this? Let me know how you want me to > fix this.
By not "fixing" anything?
> >> Is is quite unlikely thats skb is NULL. So it comes down to one extra > >> if-branching statement or one extra assignment. I would prefer extra > >> assignment to branching statement. In my opinion extra assignment is > >> very little price we pay. > >> > >> //govind > > > > Another way to solve the double NULL check is to define a new function > > something like this > > > > dev_kfree_skb_NULL(struct sk_buff **skb) > > { > > if(*skb) { > > free_skb(*skb); > > *skb=NULL; > > } > > } > > > > and use this if you want to free a skb and make it NULL. > > Is this approach better?
That's just ugly imho. Why do you want to "clean up" something that doesn't need changing?
Anyway, just saying.
johannes
| |