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 <[EMAIL PROTECTED]>
---
 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
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to