lkml.org 
[lkml]   [2005]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 01/11] list_for_each_entry: arch-i386-mm-pageattr.c
From
Date



Hi.

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-01-10 17:59:45.000000000 +0100
+++ kj-domen/arch/i386/mm/pageattr.c 2005-01-10 17:59:45.000000000 +0100
@@ -181,7 +181,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());

@@ -189,12 +189,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
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.035 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site