lkml.org 
[lkml]   [2023]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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!

\
 
 \ /
  Last update: 2023-11-22 10:42    [W:0.053 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site