All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/amd: Simplify assertions
@ 2020-05-19 11:17 Tang Bin
  0 siblings, 0 replies; only message in thread
From: Tang Bin @ 2020-05-19 11:17 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Tang Bin, Zhang Shengju

Simplifies assertions for errors.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/net/ethernet/amd/au1000_eth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 76ac3a752..328c0ddba 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1201,7 +1201,7 @@ static int au1000_probe(struct platform_device *pdev)
 	}
 
 	aup->mii_bus = mdiobus_alloc();
-	if (aup->mii_bus == NULL) {
+	if (!aup->mii_bus) {
 		dev_err(&pdev->dev, "failed to allocate mdiobus structure\n");
 		err = -ENOMEM;
 		goto err_mdiobus_alloc;
@@ -1227,7 +1227,7 @@ static int au1000_probe(struct platform_device *pdev)
 	}
 
 	err = au1000_mii_probe(dev);
-	if (err != 0)
+	if (err)
 		goto err_out;
 
 	pDBfree = NULL;
@@ -1288,7 +1288,7 @@ static int au1000_probe(struct platform_device *pdev)
 	return 0;
 
 err_out:
-	if (aup->mii_bus != NULL)
+	if (aup->mii_bus)
 		mdiobus_unregister(aup->mii_bus);
 
 	/* here we should have a valid dev plus aup-> register addresses
-- 
2.20.1.windows.1




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-19 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 11:17 [PATCH] net/amd: Simplify assertions Tang Bin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.