Skip to content

Commit 341b672

Browse files
Russell King (Oracle)davem330
authored andcommitted
net: dsa: b53: clean up if() condition to be more readable
I've stared at this if() statement for a while trying to work out if it really does correspond with the comment above, and it does seem to. However, let's make it more readable and phrase it in the same way as the comment. Also add a FIXME into the comment - we appear to deny Gigabit modes for 802.3z interface modes, but 802.3z interface modes only operate at gigabit and above. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b6553c7 commit 341b672

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,11 +1327,14 @@ void b53_phylink_validate(struct dsa_switch *ds, int port,
13271327

13281328
/* With the exclusion of 5325/5365, MII, Reverse MII and 802.3z, we
13291329
* support Gigabit, including Half duplex.
1330+
*
1331+
* FIXME: this is weird - 802.3z is always Gigabit, but we exclude
1332+
* it here. Why? This makes no sense.
13301333
*/
1331-
if (state->interface != PHY_INTERFACE_MODE_MII &&
1332-
state->interface != PHY_INTERFACE_MODE_REVMII &&
1333-
!phy_interface_mode_is_8023z(state->interface) &&
1334-
!(is5325(dev) || is5365(dev))) {
1334+
if (!(state->interface == PHY_INTERFACE_MODE_MII ||
1335+
state->interface == PHY_INTERFACE_MODE_REVMII ||
1336+
phy_interface_mode_is_8023z(state->interface) ||
1337+
is5325(dev) || is5365(dev))) {
13351338
phylink_set(mask, 1000baseT_Full);
13361339
phylink_set(mask, 1000baseT_Half);
13371340
}

0 commit comments

Comments
 (0)