netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: fec: Remove unneeded use of IS_ERR_VALUE() macro
@ 2015-08-12 15:10 Fabio Estevam
  2015-08-12 23:50 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2015-08-12 15:10 UTC (permalink / raw)
  To: davem; +Cc: Julia.Lawall, netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

There is no need to use the IS_ERR_VALUE() macro for checking
the return value from pm_runtime_* functions.

Just do a simple negative test instead.

The semantic patch that makes this change is available
in scripts/coccinelle/api/pm_runtime.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 3cebf93..787da8e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1779,7 +1779,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
 	int ret = 0;
 
 	ret = pm_runtime_get_sync(dev);
-	if (IS_ERR_VALUE(ret))
+	if (ret < 0)
 		return ret;
 
 	fep->mii_timeout = 0;
@@ -1818,7 +1818,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
 	int ret = 0;
 
 	ret = pm_runtime_get_sync(dev);
-	if (IS_ERR_VALUE(ret))
+	if (ret < 0)
 		return ret;
 
 	fep->mii_timeout = 0;
@@ -2870,7 +2870,7 @@ fec_enet_open(struct net_device *ndev)
 	int ret;
 
 	ret = pm_runtime_get_sync(&fep->pdev->dev);
-	if (IS_ERR_VALUE(ret))
+	if (ret < 0)
 		return ret;
 
 	pinctrl_pm_select_default_state(&fep->pdev->dev);
-- 
1.9.1

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

* Re: [PATCH net-next] net: fec: Remove unneeded use of IS_ERR_VALUE() macro
  2015-08-12 15:10 [PATCH net-next] net: fec: Remove unneeded use of IS_ERR_VALUE() macro Fabio Estevam
@ 2015-08-12 23:50 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-08-12 23:50 UTC (permalink / raw)
  To: festevam; +Cc: Julia.Lawall, netdev, fabio.estevam

From: Fabio Estevam <festevam@gmail.com>
Date: Wed, 12 Aug 2015 12:10:23 -0300

> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> There is no need to use the IS_ERR_VALUE() macro for checking
> the return value from pm_runtime_* functions.
> 
> Just do a simple negative test instead.
> 
> The semantic patch that makes this change is available
> in scripts/coccinelle/api/pm_runtime.cocci.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied, thanks.

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

end of thread, other threads:[~2015-08-12 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12 15:10 [PATCH net-next] net: fec: Remove unneeded use of IS_ERR_VALUE() macro Fabio Estevam
2015-08-12 23:50 ` 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).