diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2016-07-26 18:24:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 19:19:19 -0400 |
commit | e3a2713c3cfa9c41fac57447533079d8da23319b (patch) | |
tree | 1f5545696b41969571ef78903712ad02e8fec61f /mm/page_isolation.c | |
parent | 46f24fd857b37bb86ddd5d0ac3d194e984dfdf1c (diff) |
mm/page_isolation: clean up confused code
When there is an isolated_page, post_alloc_hook() is called with page
but __free_pages() is called with isolated_page. Since they are the
same so no problem but it's very confusing. To reduce it, this patch
changes isolated_page to boolean type and uses page variable
consistently.
Link: http://lkml.kernel.org/r/1466150259-27727-10-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_isolation.c')
-rw-r--r-- | mm/page_isolation.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 4639163b78f9..064b7fb6e0b5 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c | |||
@@ -81,7 +81,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) | |||
81 | { | 81 | { |
82 | struct zone *zone; | 82 | struct zone *zone; |
83 | unsigned long flags, nr_pages; | 83 | unsigned long flags, nr_pages; |
84 | struct page *isolated_page = NULL; | 84 | bool isolated_page = false; |
85 | unsigned int order; | 85 | unsigned int order; |
86 | unsigned long page_idx, buddy_idx; | 86 | unsigned long page_idx, buddy_idx; |
87 | struct page *buddy; | 87 | struct page *buddy; |
@@ -109,7 +109,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) | |||
109 | if (pfn_valid_within(page_to_pfn(buddy)) && | 109 | if (pfn_valid_within(page_to_pfn(buddy)) && |
110 | !is_migrate_isolate_page(buddy)) { | 110 | !is_migrate_isolate_page(buddy)) { |
111 | __isolate_free_page(page, order); | 111 | __isolate_free_page(page, order); |
112 | isolated_page = page; | 112 | isolated_page = true; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | } | 115 | } |
@@ -129,7 +129,7 @@ out: | |||
129 | spin_unlock_irqrestore(&zone->lock, flags); | 129 | spin_unlock_irqrestore(&zone->lock, flags); |
130 | if (isolated_page) { | 130 | if (isolated_page) { |
131 | post_alloc_hook(page, order, __GFP_MOVABLE); | 131 | post_alloc_hook(page, order, __GFP_MOVABLE); |
132 | __free_pages(isolated_page, order); | 132 | __free_pages(page, order); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||