lkml.org 
[lkml]   [2013]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next 02/13] driver: net: remove unnecessary skb NULL check before calling dev_kfree_skb_irq
From
Date
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



\
 
 \ /
  Last update: 2013-11-19 01:41    [W:0.060 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site