mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: janitor@sternwelten.at
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, domen@coderock.org
Subject: [patch 6/9]  list_for_each_entry: 	arch-i386-mm-pageattr.c
Date: Sat, 20 Nov 2004 03:31:58 +0100	[thread overview]
Message-ID: <E1CVL2c-0000uE-Bq@sputnik> (raw)




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>

---

 linux-2.6.10-rc2-bk4-max/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
--- linux-2.6.10-rc2-bk4/arch/i386/mm/pageattr.c~list-for-each-entry-safe-arch_i386_mm_pageattr	2004-11-19 17:15:01.000000000 +0100
+++ linux-2.6.10-rc2-bk4-max/arch/i386/mm/pageattr.c	2004-11-19 17:15:02.000000000 +0100
@@ -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
_

                 reply	other threads:[~2004-11-20  2:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1CVL2c-0000uE-Bq@sputnik \
    --to=janitor@sternwelten.at \
    --cc=akpm@osdl.org \
    --cc=domen@coderock.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®