lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 17 Nov 2018 12:08:00 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     claudiu.manoil@....com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        alexandru.marginean@....com, catalin.horghidan@....com
Subject: Re: [PATCH net-next 1/4] enetc: Introduce basic PF and VF ENETC
 ethernet drivers

From: Claudiu Manoil <claudiu.manoil@....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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ