[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH-L+nPqKFov4pCbEQ7n_j+FUFGKZObCawRXEE=CECqVZ4bYuQ@mail.gmail.com>
Date: Tue, 20 Feb 2024 07:24:15 +0530
From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Pavan Chebbi <pavan.chebbi@...adcom.com>, Michael Chan <mchan@...adcom.com>,
Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, David Miller <davem@...emloft.net>, Andrew Lunn <andrew@...n.ch>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] tg3: simplify tg3_phy_autoneg_cfg
On Sun, Feb 18, 2024 at 11:34 PM Heiner Kallweit <hkallweit1@...il.com> wrote:
>
> Make use of ethtool_adv_to_mmd_eee_adv_t() to simplify the code.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
LGTM
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@...adcom.com>
>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 7a07c5216..62ff4381a 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -4354,21 +4354,12 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
> if (!err) {
> u32 err2;
>
> - val = 0;
> - /* Advertise 100-BaseTX EEE ability */
> - if (advertise & ADVERTISED_100baseT_Full)
> - val |= MDIO_AN_EEE_ADV_100TX;
> - /* Advertise 1000-BaseT EEE ability */
> - if (advertise & ADVERTISED_1000baseT_Full)
> - val |= MDIO_AN_EEE_ADV_1000T;
> -
> - if (!tp->eee.eee_enabled) {
> + if (!tp->eee.eee_enabled)
> val = 0;
> - linkmode_zero(tp->eee.advertised);
> - } else {
> - mii_eee_cap1_mod_linkmode_t(tp->eee.advertised, val);
> - }
> + else
> + val = ethtool_adv_to_mmd_eee_adv_t(advertise);
>
> + mii_eee_cap1_mod_linkmode_t(tp->eee.advertised, val);
> err = tg3_phy_cl45_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
> if (err)
> val = 0;
> --
> 2.43.2
>
>
--
Regards,
Kalesh A P
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4239 bytes)
Powered by blists - more mailing lists