Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 22 Nov 2023 09:42:24 +0000 | From | "Russell King (Oracle)" <> | Subject | Re: [PATCH net-next v5 2/3] net: dsa: microchip: ksz8: Add function to configure ports with integrated PHYs |
| |
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!
| ![\](/images/icornerr.gif) |