Re: [PATCH] net: dsa: sja1105: fix speed setting for 10 MBPS
From: Russell King - ARM Linux admin
Date: Fri May 01 2020 - 14:37:29 EST
On Fri, May 01, 2020 at 06:00:52PM +0000, Walter Harms wrote:
> IMHO it would be better to use switch case here to improve readability.
>
> switch (bmcr & mask) {
>
> case BMCR_SPEED1000:
> speed = SPEED_1000;
> break;
> case BMCR_SPEED100:
> speed = SPEED_100;
> break;
> case BMCR_SPEED10:
> speed = SPEED_10;
> break;
> default:
> speed = SPEED_UNKNOWN
> }
>
> jm2c,
> wh
>
> btw: an_enabled ? why not !enabled, mich more easy to read
You misinterpret "an_enabled". It's not "negated enabled". It's not
even "disabled". It's short for "autonegotiation enabled". It's
positive logic too.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up