[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210721102239.saflmexhqhqtibxt@pengutronix.de>
Date: Wed, 21 Jul 2021 12:22:39 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Russell King <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next] net: phy: at803x: simplify custom phy id
matching
On 20.07.2021 14:33:49, Russell King wrote:
> The at803x driver contains a function, at803x_match_phy_id(), which
> tests whether the PHY ID matches the value passed, comparing phy_id
> with phydev->phy_id and testing all bits that in the driver's mask.
>
> This is the same test that is used to match the driver, with phy_id
> replaced with the driver specified ID, phydev->drv->phy_id.
>
> Hence, we already know the value of the bits being tested if we look
> at phydev->drv->phy_id directly, and we do not require a complicated
> test to check them. Test directly against phydev->drv->phy_id instead.
>
> Signed-off-by: Russell King <rmk+kernel@...linux.org.uk>
>
> ---
> drivers/net/phy/at803x.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 5d62b85a4024..0790ffcd3db6 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -532,12 +532,6 @@ static int at8031_register_regulators(struct phy_device *phydev)
> return 0;
> }
>
> -static bool at803x_match_phy_id(struct phy_device *phydev, u32 phy_id)
> -{
> - return (phydev->phy_id & phydev->drv->phy_id_mask)
> - == (phy_id & phydev->drv->phy_id_mask);
> -}
> -
Seems you've missed a conversion:
| net/phy/at803x.c: In function ‘at803x_get_features’:
| net/phy/at803x.c:706:7: error: implicit declaration of function ‘at803x_match_phy_id’ [-Werror=implicit-function-declaration]
| 706 | if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID))
| | ^~~~~~~~~~~~~~~~~~~
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists