lkml.org 
[lkml]   [2018]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers
From
From: Claudiu Manoil <claudiu.manoil@nxp.com>
Date: Thu, 15 Nov 2018 18:13:53 +0200

> + if (!nr_frags && !(flags & ENETC_TXBD_FLAGS_EX))
> + flags |= ENETC_TXBD_FLAGS_F;
> +
> + txbd->flags = flags;
> +
> + if (flags & ENETC_TXBD_FLAGS_EX) {
...
> + if (!nr_frags)
...
> + }
> +
> + frag = &skb_shinfo(skb)->frags[0];
> + for (f = 0; f < nr_frags; f++, frag++) {
...
> + }
> +
> + if (nr_frags)
> + /* last BD needs 'F' bit set */
> + txbd->flags = ENETC_TXBD_FLAGS_F;

Isn't it so much simpler to just have an unconditional:

txbd->flags |= ENETC_TXBD_FLAGS_F;

at the end of this code segment?

Then all of this code conditional on nr_frags can go away.

\
 
 \ /
  Last update: 2018-11-17 21:08    [W:0.135 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site