All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [patch 2.6.8-rc2] list_for_each_entry:
@ 2004-07-29 11:42 Domen Puncer
  2004-07-29 11:43 ` Domen Puncer
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Domen Puncer @ 2004-07-29 11:42 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

Hi.

Make code more readable with list_for_each_entry*
Compile tested.


Signed-off-by: Domen Puncer <domen@coderock.org>

--- c/arch/i386/mm/pageattr.c	Wed Jul 14 19:14:46 2004
+++ list_for_each/arch/i386/mm/pageattr.c	Thu Aug 15 18:08:02 2002
@@ -178,7 +178,7 @@
 void global_flush_tlb(void)
 { 
 	LIST_HEAD(l);
-	struct list_head* n;
+	struct page *pg, *next;
 
 	BUG_ON(irqs_disabled());
 
@@ -186,12 +186,8 @@
 	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

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-07-29 11:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-29 11:42 [Kernel-janitors] [patch 2.6.8-rc2] list_for_each_entry: Domen Puncer
2004-07-29 11:43 ` Domen Puncer
2004-07-29 11:43 ` Domen Puncer
2004-07-29 11:44 ` Domen Puncer
2004-07-29 11:44 ` Domen Puncer
2004-07-29 11:45 ` Domen Puncer
2004-07-29 11:45 ` Domen Puncer
2004-07-29 11:46 ` Domen Puncer
2004-07-29 11:46 ` Domen Puncer
2004-07-29 11:47 ` Domen Puncer
2004-07-29 11:47 ` Domen Puncer
2004-07-29 11:48 ` Domen Puncer
2004-07-29 11:48 ` Domen Puncer
2004-07-29 11:49 ` [Kernel-janitors] [patch 2.6.8-rc2] list_for_each_entry: fs-dquot.c Domen Puncer
2004-07-29 11:49 ` [Kernel-janitors] [patch 2.6.8-rc2] list_for_each_entry: Domen Puncer
2004-07-29 11:50 ` Domen Puncer
2004-07-29 11:50 ` Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.