Re: [PATCH net-next 02/13] driver: net: remove unnecessary skb NULLcheck before calling dev_kfree_skb_irq
From: Johannes Berg
Date: Mon Nov 18 2013 - 14:37:37 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/