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: <3abe172b-cbad-4879-9dbf-9257e736ec6a@lunn.ch>
Date: Thu, 22 Aug 2024 17:58:17 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Pawel Dembicki <paweldembicki@...il.com>
Cc: netdev@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: vitesse: implement MDI-X
 configuration in vsc73xx

> +static int vsc73xx_mdix_set(struct phy_device *phydev, u8 mdix)
> +{
> +	int ret;
> +	u16 val;
> +
> +	val = phy_read(phydev, MII_VSC73XX_PHY_BYPASS_CTRL);
> +
> +	switch (mdix) {
> +	case ETH_TP_MDI:
> +		val |= MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |
> +		       MII_VSC73XX_PBC_PAIR_SWAP_DIS |
> +		       MII_VSC73XX_PBC_POL_INV_DIS;
> +		break;
> +	case ETH_TP_MDI_X:
> +		/* When MDI-X auto configuration is disabled, is possible
> +		 * to force only MDI mode. Let's use autoconfig for forced
> +		 * MDIX mode.
> +		 */
> +	default:
> +		val &= ~(MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |

This could be a little bit more readable if rather than default: you
used case ETH_TP_MDI_AUTO: . Then after this code, add a real default:
which returns -EINVAL,

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ