summaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-14 18:21:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:00:49 -0500
commit0d576d20ccdeffbb7ba28053107fa6f838b67f3a (patch)
treefe024b2dc63a6010d49a852c7f21e03268962ddb /mm/swapfile.c
parent0e41e277971799bad2764ad4e6284817e9a6da5b (diff)
mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 77551a553f57..e6b8591a3ed2 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2953,11 +2953,10 @@ static void free_swap_count_continuations(struct swap_info_struct *si)
2953 struct page *head; 2953 struct page *head;
2954 head = vmalloc_to_page(si->swap_map + offset); 2954 head = vmalloc_to_page(si->swap_map + offset);
2955 if (page_private(head)) { 2955 if (page_private(head)) {
2956 struct list_head *this, *next; 2956 struct page *page, *next;
2957 list_for_each_safe(this, next, &head->lru) { 2957
2958 struct page *page; 2958 list_for_each_entry_safe(page, next, &head->lru, lru) {
2959 page = list_entry(this, struct page, lru); 2959 list_del(&page->lru);
2960 list_del(this);
2961 __free_page(page); 2960 __free_page(page);
2962 } 2961 }
2963 } 2962 }