diff mbox series

[net-next,4/8] net: phy: fixed formatting issues with braces

Message ID 1623393419-2521-5-git-send-email-liweihang@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: phy: fix some coding-style issues | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: linux@armlinux.org.uk
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 70 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

liweihang June 11, 2021, 6:36 a.m. UTC
From: Wenpeng Liang <liangwenpeng@huawei.com>

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>
---
 drivers/net/phy/fixed_phy.c  | 4 ++--
 drivers/net/phy/marvell.c    | 9 ++++-----
 drivers/net/phy/phy.c        | 3 +--
 drivers/net/phy/phy_device.c | 9 ++++-----
 drivers/net/phy/phylink.c    | 5 ++---
 5 files changed, 13 insertions(+), 17 deletions(-)

Comments

Andrew Lunn June 11, 2021, 2:41 p.m. UTC | #1
> -	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
> +	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
>  		delay = MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY;
> -	} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
> +	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
>  		delay = MII_M1111_RGMII_RX_DELAY;
> -	} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
> +	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
>  		delay = MII_M1111_RGMII_TX_DELAY;
> -	} else {
> +	else
>  		delay = 0;
> -	}

Or turn it into a switch statement?

   Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index 18d81f4..c65fb5f 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -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);
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 23751d9..d93c27a 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -809,15 +809,14 @@  static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev)
 {
 	int delay;
 
-	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
 		delay = MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY;
-	} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
+	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
 		delay = MII_M1111_RGMII_RX_DELAY;
-	} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
+	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
 		delay = MII_M1111_RGMII_TX_DELAY;
-	} else {
+	else
 		delay = 0;
-	}
 
 	return phy_modify(phydev, MII_M1111_PHY_EXT_CR,
 			  MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY,
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 1089a93..8eeb26d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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;
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 1539ea0..2b78c5c 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2904,15 +2904,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;
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 9baaa34..4040d37 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1361,11 +1361,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);