netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: weongyo.linux@gmail.com
Cc: netdev@vger.kernel.org, willemb@google.com
Subject: Re: [PATCH net-next v3] packet: uses kfree_skb() for errors.
Date: Wed, 13 Apr 2016 22:56:01 -0400 (EDT)	[thread overview]
Message-ID: <20160413.225601.721902514935757078.davem@davemloft.net> (raw)
In-Reply-To: <1460132748-23561-1-git-send-email-weongyo.linux@gmail.com>

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.

  reply	other threads:[~2016-04-14  2:56 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 [this message]
2016-04-14 21:11   ` Weongyo Jeong

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=20160413.225601.721902514935757078.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=weongyo.linux@gmail.com \
    --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).