diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2013-09-11 17:21:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:57:38 -0400 |
commit | 8080fc038e91265e1002df7cae805fc17bb772fc (patch) | |
tree | 1a42d8550e638b436a7f96ed333f0a4da6e5afcf /mm | |
parent | c33bc315fd921b1179a1d3df5756e0da6fb73944 (diff) |
mm: use zone_is_empty() instead of if(zone->spanned_pages)
Use "zone_is_empty()" instead of "if (zone->spanned_pages)".
Simplify the code, no functional change.
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory_hotplug.c | 6 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9eadad626d64..4f5df61d6016 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -230,7 +230,7 @@ static void grow_zone_span(struct zone *zone, unsigned long start_pfn, | |||
230 | zone_span_writelock(zone); | 230 | zone_span_writelock(zone); |
231 | 231 | ||
232 | old_zone_end_pfn = zone_end_pfn(zone); | 232 | old_zone_end_pfn = zone_end_pfn(zone); |
233 | if (!zone->spanned_pages || start_pfn < zone->zone_start_pfn) | 233 | if (zone_is_empty(zone) || start_pfn < zone->zone_start_pfn) |
234 | zone->zone_start_pfn = start_pfn; | 234 | zone->zone_start_pfn = start_pfn; |
235 | 235 | ||
236 | zone->spanned_pages = max(old_zone_end_pfn, end_pfn) - | 236 | zone->spanned_pages = max(old_zone_end_pfn, end_pfn) - |
@@ -305,7 +305,7 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2, | |||
305 | goto out_fail; | 305 | goto out_fail; |
306 | 306 | ||
307 | /* use start_pfn for z1's start_pfn if z1 is empty */ | 307 | /* use start_pfn for z1's start_pfn if z1 is empty */ |
308 | if (z1->spanned_pages) | 308 | if (!zone_is_empty(z1)) |
309 | z1_start_pfn = z1->zone_start_pfn; | 309 | z1_start_pfn = z1->zone_start_pfn; |
310 | else | 310 | else |
311 | z1_start_pfn = start_pfn; | 311 | z1_start_pfn = start_pfn; |
@@ -347,7 +347,7 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2, | |||
347 | goto out_fail; | 347 | goto out_fail; |
348 | 348 | ||
349 | /* use end_pfn for z2's end_pfn if z2 is empty */ | 349 | /* use end_pfn for z2's end_pfn if z2 is empty */ |
350 | if (z2->spanned_pages) | 350 | if (!zone_is_empty(z2)) |
351 | z2_end_pfn = zone_end_pfn(z2); | 351 | z2_end_pfn = zone_end_pfn(z2); |
352 | else | 352 | else |
353 | z2_end_pfn = end_pfn; | 353 | z2_end_pfn = end_pfn; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f885eb827159..7c3f8d7e2d8e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1306,7 +1306,7 @@ void mark_free_pages(struct zone *zone) | |||
1306 | int order, t; | 1306 | int order, t; |
1307 | struct list_head *curr; | 1307 | struct list_head *curr; |
1308 | 1308 | ||
1309 | if (!zone->spanned_pages) | 1309 | if (zone_is_empty(zone)) |
1310 | return; | 1310 | return; |
1311 | 1311 | ||
1312 | spin_lock_irqsave(&zone->lock, flags); | 1312 | spin_lock_irqsave(&zone->lock, flags); |