Skip to contentSkip to conversation

staging: octeon: remove braces from single-line block

PATCH In review Phillip Potter 2 participants 3 messages Feb 6, 2021 – Feb 8, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon: remove braces from single-line block

This removes the braces from the if statement that checks the physical node return value in cvm_oct_phy_setup_device, as this block contains only one statement. Fixes a style warning.

---
 drivers/staging/octeon/ethernet-mdio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +1 -2
index 0bf545849b11..b0fd083a5bf2 100644
@@ -146,9 +146,8 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
 		goto no_phy;
 
 	phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
-	if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
+	if (!phy_node && of_phy_is_fixed_link(priv->of_node))
 		phy_node = of_node_get(priv->of_node);
-	}
 	if (!phy_node)
 		goto no_phy;
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw

Hi!

Quoted 5 lines · Phillip Potter

This removes the braces from the if statement that checks the physical node return value in cvm_oct_phy_setup_device, as this block contains only one statement. Fixes a style warning.

Quoted 19 lines
---
 drivers/staging/octeon/ethernet-mdio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +1 -2
index 0bf545849b11..b0fd083a5bf2 100644
@@ -146,9 +146,8 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
 		goto no_phy;
 
 	phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
-	if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
+	if (!phy_node && of_phy_is_fixed_link(priv->of_node))
 		phy_node = of_node_get(priv->of_node);
-	}
 	if (!phy_node)
 		goto no_phy;
 
Signature · 2 lines
Best regards,
Alexander Sverdlin.
#2 lore raw
Quoted 11 lines · Alexander Sverdlin

Hi!

Quoted 5 lines · Phillip Potter

This removes the braces from the if statement that checks the physical node return value in cvm_oct_phy_setup_device, as this block contains only one statement. Fixes a style warning.

Thank you Alexander.

Quoted 11 lines
Quoted 11 lines
---
 drivers/staging/octeon/ethernet-mdio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +0 -0
index 0bf545849b11..b0fd083a5bf2 100644
@@ -146,9 +146,8 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
 		goto no_phy;
 
Quoted 12 lines
Quoted 8 lines
drivers/staging/octeon/ethernet-mdio.c +1 -2
 	phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
-	if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
+	if (!phy_node && of_phy_is_fixed_link(priv->of_node))
 		phy_node = of_node_get(priv->of_node);
-	}
 	if (!phy_node)
 		goto no_phy;
 
Signature · 2 lines
Best regards,
Alexander Sverdlin.

Regards,
Phil Potter