netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Xie He <xie.he.0141@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Network Development <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH net-next v3 2/4] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner
Date: Thu, 29 Oct 2020 12:58:05 -0400	[thread overview]
Message-ID: <CA+FuTSf_Veb8Pexix5_Nx3Ujm3P+d=0VNx6hhzPsyoBBdwQ=BQ@mail.gmail.com> (raw)
In-Reply-To: <20201028184310.7017-3-xie.he.0141@gmail.com>

On Wed, Oct 28, 2020 at 10:12 PM Xie He <xie.he.0141@gmail.com> wrote:
>
> The eth_type_trans function is called when we receive frames carrying
> Ethernet frames. This function expects a non-NULL pointer as an argument,
> and assigns it directly to skb->dev.
>
> However, the code handling other types of frames first assigns a pointer
> to "dev", and then at the end checks whether the value is NULL, and if it
> is not NULL, assigns it to skb->dev.
>
> The two flows are different. Mixing them in this function makes the code
> messy. It's better that we convert the second flow to align with how
> eth_type_trans does things.
>
> So this patch changes the code to: first make sure the pointer is not
> NULL, then assign it directly to skb->dev. "dev" is no longer needed until
> the end where we use it to update stats.

No need for dev at all then?

  reply	other threads:[~2020-10-29 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 18:43 [PATCH net-next v3 0/4] net: hdlc_fr: Add support for any Ethertype Xie He
2020-10-28 18:43 ` [PATCH net-next v3 1/4] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames Xie He
2020-10-29 16:59   ` Willem de Bruijn
2020-10-29 23:10     ` Xie He
2020-10-28 18:43 ` [PATCH net-next v3 2/4] net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner Xie He
2020-10-29 16:58   ` Willem de Bruijn [this message]
2020-10-29 23:15     ` Xie He
2020-10-28 18:43 ` [PATCH net-next v3 3/4] net: hdlc_fr: Improve the initial checks when we receive an skb Xie He
2020-10-28 18:43 ` [PATCH net-next v3 4/4] net: hdlc_fr: Add support for any Ethertype Xie He

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='CA+FuTSf_Veb8Pexix5_Nx3Ujm3P+d=0VNx6hhzPsyoBBdwQ=BQ@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=khc@pm.waw.pl \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xie.he.0141@gmail.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).