[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTSf_Veb8Pexix5_Nx3Ujm3P+d=0VNx6hhzPsyoBBdwQ=BQ@mail.gmail.com>
Date: Thu, 29 Oct 2020 12:58:05 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Xie He <xie.he.0141@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Network Development <netdev@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Krzysztof Halasa <khc@...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
On Wed, Oct 28, 2020 at 10:12 PM Xie He <xie.he.0141@...il.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?
Powered by blists - more mailing lists