diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2013-09-11 17:21:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:57:36 -0400 |
commit | c33bc315fd921b1179a1d3df5756e0da6fb73944 (patch) | |
tree | 7130a2ac95c993aebb19d4a5e777f761744a06ac /kernel/power/snapshot.c | |
parent | 674470d97958a0ec72f72caf7f6451da40159cc7 (diff) |
mm: use zone_end_pfn() instead of zone_start_pfn+spanned_pages
Use "zone_end_pfn()" instead of "zone->zone_start_pfn + zone->spanned_pages".
Simplify the code, no functional change.
[akpm@linux-foundation.org: fix build]
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 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 349587bb03e1..358a146fd4da 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -352,7 +352,7 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask) | |||
352 | struct mem_extent *ext, *cur, *aux; | 352 | struct mem_extent *ext, *cur, *aux; |
353 | 353 | ||
354 | zone_start = zone->zone_start_pfn; | 354 | zone_start = zone->zone_start_pfn; |
355 | zone_end = zone->zone_start_pfn + zone->spanned_pages; | 355 | zone_end = zone_end_pfn(zone); |
356 | 356 | ||
357 | list_for_each_entry(ext, list, hook) | 357 | list_for_each_entry(ext, list, hook) |
358 | if (zone_start <= ext->end) | 358 | if (zone_start <= ext->end) |
@@ -884,7 +884,7 @@ static unsigned int count_highmem_pages(void) | |||
884 | continue; | 884 | continue; |
885 | 885 | ||
886 | mark_free_pages(zone); | 886 | mark_free_pages(zone); |
887 | max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; | 887 | max_zone_pfn = zone_end_pfn(zone); |
888 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) | 888 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) |
889 | if (saveable_highmem_page(zone, pfn)) | 889 | if (saveable_highmem_page(zone, pfn)) |
890 | n++; | 890 | n++; |
@@ -948,7 +948,7 @@ static unsigned int count_data_pages(void) | |||
948 | continue; | 948 | continue; |
949 | 949 | ||
950 | mark_free_pages(zone); | 950 | mark_free_pages(zone); |
951 | max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; | 951 | max_zone_pfn = zone_end_pfn(zone); |
952 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) | 952 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) |
953 | if (saveable_page(zone, pfn)) | 953 | if (saveable_page(zone, pfn)) |
954 | n++; | 954 | n++; |
@@ -1041,7 +1041,7 @@ copy_data_pages(struct memory_bitmap *copy_bm, struct memory_bitmap *orig_bm) | |||
1041 | unsigned long max_zone_pfn; | 1041 | unsigned long max_zone_pfn; |
1042 | 1042 | ||
1043 | mark_free_pages(zone); | 1043 | mark_free_pages(zone); |
1044 | max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; | 1044 | max_zone_pfn = zone_end_pfn(zone); |
1045 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) | 1045 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) |
1046 | if (page_is_saveable(zone, pfn)) | 1046 | if (page_is_saveable(zone, pfn)) |
1047 | memory_bm_set_bit(orig_bm, pfn); | 1047 | memory_bm_set_bit(orig_bm, pfn); |
@@ -1093,7 +1093,7 @@ void swsusp_free(void) | |||
1093 | unsigned long pfn, max_zone_pfn; | 1093 | unsigned long pfn, max_zone_pfn; |
1094 | 1094 | ||
1095 | for_each_populated_zone(zone) { | 1095 | for_each_populated_zone(zone) { |
1096 | max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; | 1096 | max_zone_pfn = zone_end_pfn(zone); |
1097 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) | 1097 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) |
1098 | if (pfn_valid(pfn)) { | 1098 | if (pfn_valid(pfn)) { |
1099 | struct page *page = pfn_to_page(pfn); | 1099 | struct page *page = pfn_to_page(pfn); |
@@ -1755,7 +1755,7 @@ static int mark_unsafe_pages(struct memory_bitmap *bm) | |||
1755 | 1755 | ||
1756 | /* Clear page flags */ | 1756 | /* Clear page flags */ |
1757 | for_each_populated_zone(zone) { | 1757 | for_each_populated_zone(zone) { |
1758 | max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; | 1758 | max_zone_pfn = zone_end_pfn(zone); |
1759 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) | 1759 | for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) |
1760 | if (pfn_valid(pfn)) | 1760 | if (pfn_valid(pfn)) |
1761 | swsusp_unset_page_free(pfn_to_page(pfn)); | 1761 | swsusp_unset_page_free(pfn_to_page(pfn)); |