OSDN Git Service

net: phy: fix formatting issues with braces
authorWenpeng Liang <liangwenpeng@huawei.com>
Wed, 16 Jun 2021 10:01:23 +0000 (18:01 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jun 2021 19:34:07 +0000 (12:34 -0700)
Fix following format issues:
1. open brace '{' following function definitions should go to the next
   line.
2. braces {} are not necessary for single line statements.
3. else should follow close brace '}'.

Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/fixed_phy.c
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
drivers/net/phy/phylink.c

index 18d81f4..c65fb5f 100644 (file)
@@ -161,8 +161,8 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
 }
 
 int fixed_phy_add(unsigned int irq, int phy_addr,
-                 struct fixed_phy_status *status) {
-
+                 struct fixed_phy_status *status)
+{
        return fixed_phy_add_gpiod(irq, phy_addr, status, NULL);
 }
 EXPORT_SYMBOL_GPL(fixed_phy_add);
index 1089a93..8eeb26d 100644 (file)
@@ -380,8 +380,7 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
                                        else if (val & BMCR_SPEED100)
                                                phydev->speed = SPEED_100;
                                        else phydev->speed = SPEED_10;
-                               }
-                               else {
+                               } else {
                                        if (phydev->autoneg == AUTONEG_DISABLE)
                                                change_autoneg = true;
                                        phydev->autoneg = AUTONEG_ENABLE;
index 8573430..5d5f9a9 100644 (file)
@@ -3021,15 +3021,14 @@ static int phy_probe(struct device *dev)
         * a controller will attach, and may modify one
         * or both of these values
         */
-       if (phydrv->features) {
+       if (phydrv->features)
                linkmode_copy(phydev->supported, phydrv->features);
-       } else if (phydrv->get_features) {
+       else if (phydrv->get_features)
                err = phydrv->get_features(phydev);
-       } else if (phydev->is_c45) {
+       else if (phydev->is_c45)
                err = genphy_c45_pma_read_abilities(phydev);
-       } else {
+       else
                err = genphy_read_abilities(phydev);
-       }
 
        if (err)
                goto out;
index 35f22a9..eb29ef5 100644 (file)
@@ -1383,11 +1383,10 @@ int phylink_ethtool_ksettings_get(struct phylink *pl,
 
        ASSERT_RTNL();
 
-       if (pl->phydev) {
+       if (pl->phydev)
                phy_ethtool_ksettings_get(pl->phydev, kset);
-       } else {
+       else
                kset->base.port = pl->link_port;
-       }
 
        linkmode_copy(kset->link_modes.supported, pl->supported);