[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fbf293df6bf4bf79f9a8ffd728c6e2c@AcuMS.aculab.com>
Date: Thu, 5 Dec 2024 02:50:32 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Oleksij Rempel' <o.rempel@...gutronix.de>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Andrew Lunn
<andrew+netdev@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>, "Jonathan
Corbet" <corbet@....net>
CC: "kernel@...gutronix.de" <kernel@...gutronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Simon Horman
<horms@...nel.org>, Russell King <linux@...linux.org.uk>, Maxime Chevallier
<maxime.chevallier@...tlin.com>, "linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>
Subject: RE: [PATCH net-next v1 3/7] phy: replace bitwise flag definitions
with BIT() macro
From: Oleksij Rempel
> Sent: 03 December 2024 07:56
>
> Convert the PHY flag definitions to use the BIT() macro instead of
> hexadecimal values. This improves readability and maintainability.
>
> No functional changes are introduced by this modification.
Are you absolutely sure.
You are changing the type of the constants from 'signed int' to
'unsigned long' and that can easily have unexpected consequences.
Especially since MDIO_DEVICE_IS_PHY was negative.
David
>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
> include/linux/phy.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 20a0d43ab5d4..a6c47b0675af 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -86,11 +86,11 @@ extern const int phy_10gbit_features_array[1];
> #define PHY_POLL -1
> #define PHY_MAC_INTERRUPT -2
>
> -#define PHY_IS_INTERNAL 0x00000001
> -#define PHY_RST_AFTER_CLK_EN 0x00000002
> -#define PHY_POLL_CABLE_TEST 0x00000004
> -#define PHY_ALWAYS_CALL_SUSPEND 0x00000008
> -#define MDIO_DEVICE_IS_PHY 0x80000000
> +#define PHY_IS_INTERNAL BIT(0)
> +#define PHY_RST_AFTER_CLK_EN BIT(1)
> +#define PHY_POLL_CABLE_TEST BIT(2)
> +#define PHY_ALWAYS_CALL_SUSPEND BIT(3)
> +#define MDIO_DEVICE_IS_PHY BIT(31)
>
> /**
> * enum phy_interface_t - Interface Mode definitions
> --
> 2.39.5
>
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists