staging: rtl8712: Use list iterators and helpers
[linux-2.6-block.git] / drivers / staging / rtl8712 / rtl871x_mlme.c
index ba4a71e91ae075e862ba82e2b265e27fb62f0ade..92b7c9c07df67d8769749e702969a0acbc4e64d3 100644 (file)
@@ -139,10 +139,8 @@ static struct wlan_network *r8712_find_network(struct  __queue *scanned_queue,
                return NULL;
        spin_lock_irqsave(&scanned_queue->lock, irqL);
        phead = &scanned_queue->queue;
-       plist = phead->next;
-       while (plist != phead) {
-               pnetwork = container_of(plist, struct wlan_network, list);
-               plist = plist->next;
+       list_for_each(plist, phead) {
+               pnetwork = list_entry(plist, struct wlan_network, list);
                if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
                        break;
        }