[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1GK9Aklzs-a2oPQ@pengutronix.de>
Date: Thu, 5 Dec 2024 12:13:56 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: David Laight <David.Laight@...lab.com>
Cc: "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>,
"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
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 |
Powered by blists - more mailing lists