Re: [PATCH net-next v1 3/7] phy: replace bitwise flag definitions with BIT() macro
From: Oleksij Rempel
Date: Thu Dec 05 2024 - 06:14:14 EST
On Thu, Dec 05, 2024 at 02:50:32AM +0000, David Laight wrote:
> 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.
In current kernel code following flags are assigned to u32 variable:
> > -#define PHY_IS_INTERNAL 0x00000001
> > -#define PHY_RST_AFTER_CLK_EN 0x00000002
> > -#define PHY_POLL_CABLE_TEST 0x00000004
> > -#define PHY_ALWAYS_CALL_SUSPEND 0x00000008
phydrv->flags (u32)
This one is assigned to an int:
> > -#define MDIO_DEVICE_IS_PHY 0x80000000
mdiodrv->flags (int)
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |