* [PATCH] mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
@ 2015-12-15 15:04 Geliang Tang
0 siblings, 0 replies; only message in thread
From: Geliang Tang @ 2015-12-15 15:04 UTC (permalink / raw)
To: Andrew Morton, Kirill A. Shutemov, Jerome Marchand,
Vlastimil Babka, Al Viro
Cc: Geliang Tang, linux-mm, linux-kernel
Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
mm/swapfile.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 7c714c6..31dc94f 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2957,11 +2957,10 @@ static void free_swap_count_continuations(struct swap_info_struct *si)
struct page *head;
head = vmalloc_to_page(si->swap_map + offset);
if (page_private(head)) {
- struct list_head *this, *next;
- list_for_each_safe(this, next, &head->lru) {
- struct page *page;
- page = list_entry(this, struct page, lru);
- list_del(this);
+ struct page *page, *next;
+
+ list_for_each_entry_safe(page, next, &head->lru, lru) {
+ list_del(&page->lru);
__free_page(page);
}
}
--
2.5.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-15 15:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 15:04 [PATCH] mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations Geliang Tang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox