From: Geliang Tang Date: Thu, 14 Jan 2016 23:21:49 +0000 (-0800) Subject: mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d576d20ccdeffbb7ba28053107fa6f838b67f3a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) 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); } }