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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 May 2015 20:03:09 +0200
From:	Joachim Eastwood <manabian@...il.com>
To:	peppe.cavallaro@...com
Cc:	Joachim Eastwood <manabian@...il.com>, netdev@...r.kernel.org,
	davem@...emloft.net, arnd@...db.de,
	linux-arm-kernel@...ts.infradead.org
Subject: [PATCH net-next 4/4] stmmac: drop unnecessary dt checks in stmmac_probe_config_dt

Since the caller already check the presence of a of_node there
is no need to repeat the check in stmmac_probe_config_dt.

There is also no point in checking the return value of the
of_match_device function since if there wasn't match in the
first place we would never be in this function.

Signed-off-by: Joachim Eastwood <manabian@...il.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 10de9351a1ec..d2bb7907bf61 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -111,13 +111,7 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 	const struct of_device_id *device;
 	struct device *dev = &pdev->dev;
 
-	if (!np)
-		return -ENODEV;
-
 	device = of_match_device(dev->driver->of_match_table, dev);
-	if (!device)
-		return -ENODEV;
-
 	if (device->data) {
 		const struct stmmac_of_data *data = device->data;
 		plat->has_gmac = data->has_gmac;
-- 
1.8.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

Powered by Openwall GNU/*/Linux Powered by OpenVZ