Re: [net-next PATCH 1/2] net: ethtool: add define for link speed mode number

From: Russell King (Oracle)
Date: Wed Dec 13 2023 - 15:11:14 EST


NAK.

You *clearly* didn't look before you leaped.

On Wed, Dec 13, 2023 at 07:15:53PM +0100, Christian Marangi wrote:
> +enum ethtool_link_speeds {
> + SPEED_10 = 0,
> + SPEED_100,
> + SPEED_1000,
...

and from the context immediately below, included in your patch:
> #define SPEED_10 10
^^^^^^^^
> #define SPEED_100 100
^^^^^^^^^
> #define SPEED_1000 1000
^^^^^^^^^^

Your enumerated values will be overridden by the preprocessor
definitions.

Moreover, SPEED_xxx is an already taken namespace and part of the UAPI,
and thus can _not_ be changed. Convention is that SPEED_x will be
defined as the numeric speed.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!