mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 01/12] list_for_each_entry: arch-i386-mm-pageattr.c
@ 2005-03-05 15:35 domen
  0 siblings, 0 replies; only message in thread
From: domen @ 2005-03-05 15:35 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, domen, janitor




Make code more readable with list_for_each_entry*
Compile tested.

Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/arch/i386/mm/pageattr.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff -puN arch/i386/mm/pageattr.c~list-for-each-entry-safe-arch_i386_mm_pageattr arch/i386/mm/pageattr.c
--- kj/arch/i386/mm/pageattr.c~list-for-each-entry-safe-arch_i386_mm_pageattr	2005-03-05 16:09:04.000000000 +0100
+++ kj-domen/arch/i386/mm/pageattr.c	2005-03-05 16:09:04.000000000 +0100
@@ -189,7 +189,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());
 
@@ -197,12 +197,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
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-05 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-05 15:35 [patch 01/12] list_for_each_entry: arch-i386-mm-pageattr.c domen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome