diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2013-09-11 23:21:45 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 00:57:38 +0200 |
commit | 8080fc038e91265e1002df7cae805fc17bb772fc (patch) | |
tree | 1a42d8550e638b436a7f96ed333f0a4da6e5afcf /mm/memory_hotplug.c | |
parent | mm: use zone_end_pfn() instead of zone_start_pfn+spanned_pages (diff) | |
download | linux-8080fc038e91265e1002df7cae805fc17bb772fc.tar.xz linux-8080fc038e91265e1002df7cae805fc17bb772fc.zip |
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/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 6 |
1 files changed, 3 insertions, 3 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, zone_span_writelock(zone); old_zone_end_pfn = zone_end_pfn(zone); - if (!zone->spanned_pages || start_pfn < zone->zone_start_pfn) + if (zone_is_empty(zone) || start_pfn < zone->zone_start_pfn) zone->zone_start_pfn = start_pfn; 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, goto out_fail; /* use start_pfn for z1's start_pfn if z1 is empty */ - if (z1->spanned_pages) + if (!zone_is_empty(z1)) z1_start_pfn = z1->zone_start_pfn; else z1_start_pfn = start_pfn; @@ -347,7 +347,7 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2, goto out_fail; /* use end_pfn for z2's end_pfn if z2 is empty */ - if (z2->spanned_pages) + if (!zone_is_empty(z2)) z2_end_pfn = zone_end_pfn(z2); else z2_end_pfn = end_pfn; |