diff mbox

net: phy: dp83867: fix simple_return.cocci warnings

Message ID 20150724061610.GA37457@lkp-nex05
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

kbuild test robot July 24, 2015, 6:16 a.m. UTC
drivers/net/phy/dp83867.c:126:1-4: WARNING: end returns can be simpified
drivers/net/phy/dp83867.c:74:5-8: WARNING: end returns can be simpified if tested value is negative or 0

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 dp83867.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller July 27, 2015, 7:59 a.m. UTC | #1
From: kbuild test robot <fengguang.wu@intel.com>
Date: Fri, 24 Jul 2015 14:16:10 +0800

> drivers/net/phy/dp83867.c:126:1-4: WARNING: end returns can be simpified
> drivers/net/phy/dp83867.c:74:5-8: WARNING: end returns can be simpified if tested value is negative or 0
> 
>  Simplify a trivial if-return sequence.  Possibly combine with a
>  preceding function call.
> 
> Generated by: scripts/coccinelle/misc/simple_return.cocci
> 
> CC: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -123,12 +123,8 @@  static int dp83867_of_init(struct phy_de
 	if (ret)
 		return ret;
 
-	ret = of_property_read_u32(of_node, "ti,fifo-depth",
+	return of_property_read_u32(of_node, "ti,fifo-depth",
 				   &dp83867->fifo_depth);
-	if (ret)
-		return ret;
-
-	return 0;
 }
 #else
 static int dp83867_of_init(struct phy_device *phydev)