[PATCH 5/5] mm/page_alloc.c: Use list_for_each_entry instead of list_for_each

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mm/page_alloc.c: Convert list_for_each to list_for_each_entry in
mark_free_pages()

Signed-off-by: Matthias Kaehlcke <[email protected]>

--

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 05ace44..1f138fb 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -731,7 +731,7 @@ void mark_free_pages(struct zone *zone)
 	unsigned long pfn, max_zone_pfn;
 	unsigned long flags;
 	int order;
-	struct list_head *curr;
+	struct page *curr_page;
 
 	if (!zone->spanned_pages)
 		return;
@@ -748,10 +748,11 @@ void mark_free_pages(struct zone *zone)
 		}
 
 	for (order = MAX_ORDER - 1; order >= 0; --order)
-		list_for_each(curr, &zone->free_area[order].free_list) {
+		list_for_each_entry(curr_page,
+				    &zone->free_area[order].free_list, lru) {
 			unsigned long i;
 
-			pfn = page_to_pfn(list_entry(curr, struct page, lru));
+			pfn = page_to_pfn(curr_page);
 			for (i = 0; i < (1UL << order); i++)
 				swsusp_set_page_free(pfn_to_page(pfn + i));
 		}

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

              La posibilidad de realizar un suenyo es lo
                 que hace que la vida sea interesante
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux