lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Sep 2020 18:05:32 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     davem@...emloft.net, andrew@...n.ch, hkallweit1@...il.com,
        kuba@...nel.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>,
        Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: [PATCH] net: mdio: Remove redundant parameter and check

In the function ipq8064_mdio_probe(), of_mdiobus_register() might
returned zero, so the direct return can simplify code. Thus remove
redundant parameter and check.

Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 drivers/net/mdio/mdio-ipq8064.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c
index 1bd1885..33cccce 100644
--- a/drivers/net/mdio/mdio-ipq8064.c
+++ b/drivers/net/mdio/mdio-ipq8064.c
@@ -102,7 +102,6 @@ ipq8064_mdio_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct ipq8064_mdio *priv;
 	struct mii_bus *bus;
-	int ret;
 
 	bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv));
 	if (!bus)
@@ -125,12 +124,9 @@ ipq8064_mdio_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 	}
 
-	ret = of_mdiobus_register(bus, np);
-	if (ret)
-		return ret;
-
 	platform_set_drvdata(pdev, bus);
-	return 0;
+
+	return of_mdiobus_register(bus, np);
 }
 
 static int
-- 
2.20.1.windows.1



Powered by blists - more mailing lists