Re: [PATCH net-next v5 2/3] net: dsa: microchip: ksz8: Add function to configure ports with integrated PHYs

From: Russell King (Oracle)
Date: Wed Nov 22 2023 - 04:42:47 EST


On Wed, Nov 22, 2023 at 10:25:44AM +0100, Oleksij Rempel wrote:
> + if (duplex) {

Unnecessary.

> + bool aneg_en = false;
> +
> + ret = ksz_pread8(dev, port, regs[P_FORCE_CTRL], &ctrl);
> + if (ret)
> + return;
> +
> + if (ksz_is_ksz88x3(dev)) {
> + if ((ctrl & PORT_AUTO_NEG_ENABLE))

Too many parens.

> + aneg_en = true;

Simpler:
aneg_en = ctrl & PORT_AUTO_NEG_ENABLE;

> + } else {
> + if (!(ctrl & PORT_AUTO_NEG_DISABLE))
> + aneg_en = true;

Simpler:
aneg_en = !(ctrl & PORT_AUTO_NEG_DISABLE);

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!