staging: rtl8188eu: while loop replaced by for loop
authorIvan Safonov <insafonov@gmail.com>
Mon, 2 Nov 2015 17:16:28 +0000 (00:16 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
Here is more suitable for loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme.c

index 1bf5c48198972204095a79a6c1ca4a214182f8f2..abab854e68898ce0ed2b6d81e8dd44f50c917ee0 100644 (file)
@@ -366,20 +366,13 @@ struct    wlan_network    *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
 
        phead = get_list_head(scanned_queue);
 
-       plist = phead->next;
-
-       while (1) {
-               if (phead == plist)
-                       break;
-
+       for (plist = phead->next; plist != phead; plist = plist->next) {
                pwlan = container_of(plist, struct wlan_network, list);
 
                if (!pwlan->fixed) {
                        if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned))
                                oldest = pwlan;
                }
-
-               plist = plist->next;
        }
        return oldest;
 }