OSDN Git Service

net: mii: mii_lpa_mod_linkmode_lpa_t: Make use of linkmode_mod_bit helper
authorAndrew Lunn <andrew@lunn.ch>
Wed, 5 Dec 2018 20:49:44 +0000 (21:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Dec 2018 00:26:16 +0000 (16:26 -0800)
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>
include/linux/mii.h

index e724477..6fee8b1 100644 (file)
@@ -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);
 }
 
 /**