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:   Fri, 15 Jan 2021 15:39:11 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Tobias Waldekranz <tobias@...dekranz.com>
Cc:     davem@...emloft.net, kuba@...nel.org, vivien.didelot@...il.com,
        f.fainelli@...il.com, olteanv@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Only allow LAG offload
 on supported hardware

> +static inline bool mv88e6xxx_has_lag(struct mv88e6xxx_chip *chip)
> +{
> +#if (defined(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2))
> +	return chip->info->global2_addr != 0;
> +#else
> +	return false;
> +#endif

Given Vladimirs comments, this is just FYI:

You should not use #if like this. Use

	if (IS_ENABLED(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2))
		return chip->info->global2_addr != 0;
	return false;

The advantage of this is it all gets compiled, so syntax errors in the
mostly unused leg get found quickly. The generated code should still
be optimal, since at build time it can evaluate the if and completely
remove it.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ