From: Geliang Tang Date: Wed, 20 Jan 2016 23:00:34 +0000 (-0800) Subject: kernel/kexec_core.c: use list_for_each_entry_safe in kimage_free_page_list X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b24692b9235cb82b6f735b7a4c4137211ddf005;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kernel/kexec_core.c: use list_for_each_entry_safe in kimage_free_page_list Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang Cc: Dave Young Cc: Vivek Goyal Acked-by: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index c823f3001e12..8dc659144869 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -310,12 +310,9 @@ static void kimage_free_pages(struct page *page) void kimage_free_page_list(struct list_head *list) { - struct list_head *pos, *next; + struct page *page, *next; - list_for_each_safe(pos, next, list) { - struct page *page; - - page = list_entry(pos, struct page, lru); + list_for_each_entry_safe(page, next, list, lru) { list_del(&page->lru); kimage_free_pages(page); }