netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.3.0 1/3] net:phy:bcm63xx: remove unnecessary code
@ 2012-04-02 16:24 Srinivas KANDAGATLA
  2012-04-02 16:42 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Srinivas KANDAGATLA @ 2012-04-02 16:24 UTC (permalink / raw)
  To: netdev; +Cc: davem, srinivas.kandagatla

From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

Compile tested.
remove unnecessary code that matches this coccinelle pattern

	ret = phy_write(x, y , z)
	if (ret < 0)
		return ret;
	return 0;

As phy_write returns error code, we dont need to do not need extra check
before returning.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
 drivers/net/phy/bcm63xx.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/bcm63xx.c b/drivers/net/phy/bcm63xx.c
index e16f98c..cd802eb 100644
--- a/drivers/net/phy/bcm63xx.c
+++ b/drivers/net/phy/bcm63xx.c
@@ -39,10 +39,7 @@ static int bcm63xx_config_init(struct phy_device *phydev)
 		MII_BCM63XX_IR_SPEED |
 		MII_BCM63XX_IR_LINK) |
 		MII_BCM63XX_IR_EN;
-	err = phy_write(phydev, MII_BCM63XX_IR, reg);
-	if (err < 0)
-		return err;
-	return 0;
+	return phy_write(phydev, MII_BCM63XX_IR, reg);
 }
 
 static int bcm63xx_ack_interrupt(struct phy_device *phydev)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-03 23:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 16:24 [PATCH 3.3.0 1/3] net:phy:bcm63xx: remove unnecessary code Srinivas KANDAGATLA
2012-04-02 16:42 ` Joe Perches
2012-04-02 16:51   ` Srinivas KANDAGATLA
2012-04-02 17:02     ` Joe Perches
2012-04-03  9:49       ` Srinivas KANDAGATLA
2012-04-03 23:02         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).