[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1443012150-29136-1-git-send-email-tklauser@distanz.ch>
Date: Wed, 23 Sep 2015 14:42:30 +0200
From: Tobias Klauser <tklauser@...tanz.ch>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: netdev@...r.kernel.org
Subject: [PATCH] net: phy: Use IS_ERR_OR_NULL instead of open coding it
Replace the pattern (!phy | IS_ERR(phy)) by the equivalent macro
IS_ERR_OR_NULL()
Signed-off-by: Tobias Klauser <tklauser@...tanz.ch>
---
drivers/net/phy/fixed_phy.c | 2 +-
drivers/net/phy/mdio_bus.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index fb1299c..bde4378 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -330,7 +330,7 @@ struct phy_device *fixed_phy_register(unsigned int irq,
return ERR_PTR(ret);
phy = get_phy_device(fmb->mii_bus, phy_addr, false);
- if (!phy || IS_ERR(phy)) {
+ if (IS_ERR_OR_NULL(phy)) {
fixed_phy_del(phy_addr);
return ERR_PTR(-EINVAL);
}
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 02a4615..4a48d6a 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -341,7 +341,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
int err;
phydev = get_phy_device(bus, addr, false);
- if (IS_ERR(phydev) || phydev == NULL)
+ if (IS_ERR_OR_NULL(phydev))
return phydev;
/*
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists