netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Weongyo Jeong <weongyo.linux@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, willemb@google.com
Subject: Re: [PATCH net-next v3] packet: uses kfree_skb() for errors.
Date: Thu, 14 Apr 2016 14:11:48 -0700	[thread overview]
Message-ID: <20160414211147.GA15463@jwg> (raw)
In-Reply-To: <20160413.225601.721902514935757078.davem@davemloft.net>

On Wed, Apr 13, 2016 at 10:56:01PM -0400, David Miller wrote:
> From: Weongyo Jeong <weongyo.linux@gmail.com>
> Date: Fri,  8 Apr 2016 09:25:48 -0700
> 
> > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> > index 1ecfa71..4e054bb 100644
> > --- a/net/packet/af_packet.c
> > +++ b/net/packet/af_packet.c
> > @@ -2042,6 +2042,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
> >  	u8 *skb_head = skb->data;
> >  	int skb_len = skb->len;
> >  	unsigned int snaplen, res;
> > +	bool err = false;
> >  
> >  	if (skb->pkt_type == PACKET_LOOPBACK)
> >  		goto drop;
> 
> It is non-canonical to use a variable named 'err' as a boolean.
> Instead, all programmers expect a variable named 'err' to be an
> integer type and to hold an error code.
> 
> Therefore please use a more appropriate name for this variable.
> 
> Name it in a way which describes the exact important condition
> which is true or false.
> 
> Thank you.

Thank you for your opinion.  I'd fixed it to proper name and
submitted v4 patch.

Regards,
Weongyo Jeong

      reply	other threads:[~2016-04-14 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 16:25 [PATCH net-next v3] packet: uses kfree_skb() for errors Weongyo Jeong
2016-04-14  2:56 ` David Miller
2016-04-14 21:11   ` Weongyo Jeong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160414211147.GA15463@jwg \
    --to=weongyo.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).