list_for_each_entry: arch-i386-mm-pageattr.c
PATCH 6/9 list_for_each_entry: arch-i386-mm-pageattr.c
Hi.
Make code more readable with list_for_each_entry*
Compile tested.
Signed-off-by Domen Puncer <[email protected]>
Signed-off-by Maximilian Attems <[email protected]>
---
linux-2.6.10-rc2-bk4-max/arch/i386/mm/pageattr.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
arch/i386/mm/pageattr.c renamed from arch/i386/mm/pageattr.c~list-for-each-entry-safe-arch_i386_mm_pageattr +2 -6
@@ -178,7 +178,7 @@ int change_page_attr(struct page *page,void global_flush_tlb (void ) {LIST_HEAD (l); -struct list_head * n; +struct page *pg, *next;BUG_ON (irqs_disabled ());
@@ -186,12 +186,8 @@ void global_flush_tlb(void)list_splice_init (&df_list, &l);spin_unlock_irq (&cpa_lock);flush_map (); - n = l.next; -while (n != &l) { - struct page *pg = list_entry(n, struct page, lru); - n = n->next; +list_for_each_entry_safe (pg, next, &l, lru)__free_page (pg); - } }#ifdef CONFIG_DEBUG_PAGEALLOC
_