lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9g8wOED58xKwu4m@lunn.ch>
Date:   Mon, 30 Jan 2023 22:55:12 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Oleksij Rempel <o.rempel@...gutronix.de>
Cc:     Woojung Huh <woojung.huh@...rochip.com>,
        UNGLinuxDriver@...rochip.com,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, kernel@...gutronix.de,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        Arun.Ramadoss@...rochip.com
Subject: Re: [PATCH net-next v3 02/15] net: phy: add
 genphy_c45_read_eee_abilities() function

> +static inline void mii_eee_100_10000_adv_mod_linkmode_t(unsigned long *adv,
> +							u32 val)
> +{
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
> +			 adv, val & MDIO_EEE_100TX);
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
> +			 adv, val & MDIO_EEE_1000T);
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
> +			 adv, val & MDIO_EEE_10GT);
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
> +			 adv, val & MDIO_EEE_1000KX);
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT,
> +			 adv, val & MDIO_EEE_10GKX4);
> +	linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKR_Full_BIT,
> +			 adv, val & MDIO_EEE_10GKR);
> +}

This and mmd_eee_cap_to_ethtool_sup_t() are very similar. Could you
try to remove the duplication. Maybe
ethtool_convert_link_mode_to_legacy_u32() could be used?

	Andrew					  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ