summaryrefslogtreecommitdiff
path: root/include/linux/mii.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-12-05 21:49:44 +0100
committerDavid S. Miller <davem@davemloft.net>2018-12-05 16:26:16 -0800
commit6dbd0090f999c443763c0742b574da1ce189404c (patch)
tree64f58ed614f1c578b8ffbd3577e6ca7b85d9487e /include/linux/mii.h
parentd3351931a37bdb329b5ea761424579fa91c866ee (diff)
net: mii: mii_lpa_mod_linkmode_lpa_t: Make use of linkmode_mod_bit helper
Replace the if else code structure with a call to the helper linkmode_mod_bit. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mii.h')
-rw-r--r--include/linux/mii.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/mii.h b/include/linux/mii.h
index e72447778a08..6fee8b1a4400 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -451,12 +451,8 @@ static inline void mii_lpa_mod_linkmode_lpa_t(unsigned long *lp_advertising,
{
mii_adv_mod_linkmode_adv_t(lp_advertising, lpa);
- if (lpa & LPA_LPACK)
- linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- lp_advertising);
- else
- linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- lp_advertising);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ lp_advertising, lpa & LPA_LPACK);
}
/**