Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=426921bda10c33231e2b335e4ad08bc755c50740
Commit:     426921bda10c33231e2b335e4ad08bc755c50740
Parent:     777fa98194f91dae24fd12de47eec1cbb0375b29
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 12:03:32 2007 -0700
Committer:  John W. Linville <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 14:25:40 2007 -0400

    [PATCH] use list_for_each_entry() for iteration in Prism 54 driver
    
    Use list_for_each_entry() instead of manual iteration and substitute a
    list_for_each_safe() loop with list_for_each_entry_safe()
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Acked-by: Luis R. Rodriguez <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/prism54/isl_ioctl.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/prism54/isl_ioctl.c 
b/drivers/net/wireless/prism54/isl_ioctl.c
index 283be4a..585f599 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -1853,7 +1853,6 @@ prism54_del_mac(struct net_device *ndev, struct 
iw_request_info *info,
        islpci_private *priv = netdev_priv(ndev);
        struct islpci_acl *acl = &priv->acl;
        struct mac_entry *entry;
-       struct list_head *ptr;
        struct sockaddr *addr = (struct sockaddr *) extra;
 
        if (addr->sa_family != ARPHRD_ETHER)
@@ -1861,11 +1860,9 @@ prism54_del_mac(struct net_device *ndev, struct 
iw_request_info *info,
 
        if (down_interruptible(&acl->sem))
                return -ERESTARTSYS;
-       for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
-               entry = list_entry(ptr, struct mac_entry, _list);
-
+       list_for_each_entry(entry, &acl->mac_list, _list) {
                if (memcmp(entry->addr, addr->sa_data, ETH_ALEN) == 0) {
-                       list_del(ptr);
+                       list_del(&entry->_list);
                        acl->size--;
                        kfree(entry);
                        up(&acl->sem);
@@ -1883,7 +1880,6 @@ prism54_get_mac(struct net_device *ndev, struct 
iw_request_info *info,
        islpci_private *priv = netdev_priv(ndev);
        struct islpci_acl *acl = &priv->acl;
        struct mac_entry *entry;
-       struct list_head *ptr;
        struct sockaddr *dst = (struct sockaddr *) extra;
 
        dwrq->length = 0;
@@ -1891,9 +1887,7 @@ prism54_get_mac(struct net_device *ndev, struct 
iw_request_info *info,
        if (down_interruptible(&acl->sem))
                return -ERESTARTSYS;
 
-       for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
-               entry = list_entry(ptr, struct mac_entry, _list);
-
+       list_for_each_entry(entry, &acl->mac_list, _list) {
                memcpy(dst->sa_data, entry->addr, ETH_ALEN);
                dst->sa_family = ARPHRD_ETHER;
                dwrq->length++;
@@ -1960,7 +1954,6 @@ prism54_get_policy(struct net_device *ndev, struct 
iw_request_info *info,
 static int
 prism54_mac_accept(struct islpci_acl *acl, char *mac)
 {
-       struct list_head *ptr;
        struct mac_entry *entry;
        int res = 0;
 
@@ -1972,8 +1965,7 @@ prism54_mac_accept(struct islpci_acl *acl, char *mac)
                return 1;
        }
 
-       for (ptr = acl->mac_list.next; ptr != &acl->mac_list; ptr = ptr->next) {
-               entry = list_entry(ptr, struct mac_entry, _list);
+       list_for_each_entry(entry, &acl->mac_list, _list) {
                if (memcmp(entry->addr, mac, ETH_ALEN) == 0) {
                        res = 1;
                        break;
@@ -2216,11 +2208,9 @@ prism54_wpa_bss_ie_init(islpci_private *priv)
 void
 prism54_wpa_bss_ie_clean(islpci_private *priv)
 {
-       struct list_head *ptr, *n;
+       struct islpci_bss_wpa_ie *bss, *n;
 
-       list_for_each_safe(ptr, n, &priv->bss_wpa_list) {
-               struct islpci_bss_wpa_ie *bss;
-               bss = list_entry(ptr, struct islpci_bss_wpa_ie, list);
+       list_for_each_entry_safe(bss, n, &priv->bss_wpa_list, list) {
                kfree(bss);
        }
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to