projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e41e27
)
mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
author
Geliang Tang
<
[email protected]
>
Thu, 14 Jan 2016 23:21:49 +0000
(15:21 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 15 Jan 2016 00:00:49 +0000
(16:00 -0800)
Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.
Signed-off-by: Geliang Tang <
[email protected]
>
Cc: Hugh Dickins <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/swapfile.c
patch
|
blob
|
history
diff --git
a/mm/swapfile.c
b/mm/swapfile.c
index 77551a553f57d0d8657854a4f176ec109f4c836a..e6b8591a3ed27641b70179265609671135ae4127 100644
(file)
--- 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);
}
}