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>] [day] [month] [year] [list]
Message-ID: <20070218222619.GA7366@unknown-00-0d-60-79-ca-00.lan>
Date:	Sun, 18 Feb 2007 23:26:19 +0100
From:	Thomas Hisch <t.hisch@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: [Patch] net/core: change hlist_for_each/hlist_entry to
	hlist_for_each_entry

change occurrence of hlist_for_each/hlist_entry to hlist_for_each_entry as it
combines the previous two macros

Signed-off-by: Thomas Hisch <t.hisch@...il.com>
---
 net/core/dev.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index cf71614..83c2f43 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -475,13 +475,11 @@ __setup("netdev=", netdev_boot_setup);
 struct net_device *__dev_get_by_name(const char *name)
 {
 	struct hlist_node *p;
+	struct net_device *dev;
 
-	hlist_for_each(p, dev_name_hash(name)) {
-		struct net_device *dev
-			= hlist_entry(p, struct net_device, name_hlist);
+	hlist_for_each_entry(dev, p, dev_name_hash(name), name_hlist)
 		if (!strncmp(dev->name, name, IFNAMSIZ))
 			return dev;
-	}
 	return NULL;
 }
 
@@ -522,13 +520,11 @@ struct net_device *dev_get_by_name(const char *name)
 struct net_device *__dev_get_by_index(int ifindex)
 {
 	struct hlist_node *p;
+	struct net_device *dev;
 
-	hlist_for_each(p, dev_index_hash(ifindex)) {
-		struct net_device *dev
-			= hlist_entry(p, struct net_device, index_hlist);
+	hlist_for_each_entry(dev, p, dev_index_hash(ifindex), index_hlist)
 		if (dev->ifindex == ifindex)
 			return dev;
-	}
 	return NULL;
 }
 
@@ -2878,6 +2874,7 @@ int register_netdevice(struct net_device *dev)
 {
 	struct hlist_head *head;
 	struct hlist_node *p;
+	struct net_device *d;
 	int ret;
 
 	BUG_ON(dev_boot_phase);
@@ -2918,9 +2915,7 @@ int register_netdevice(struct net_device *dev)
 
 	/* Check for existence of name */
 	head = dev_name_hash(dev->name);
-	hlist_for_each(p, head) {
-		struct net_device *d
-			= hlist_entry(p, struct net_device, name_hlist);
+	hlist_for_each_entry(d, p, head, name_hlist) {
 		if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
 			ret = -EEXIST;
 			goto out;
-- 
1.5.0-rc2.GIT

-- 
Thomas Hisch
e0625874@...d.tuwien.ac.at
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ