mm/page_owner.c: clean up init_pages_in_zone()
Subsystems (2)
[email protected]
maintainerPATCH 99/119 mm/page_owner.c: clean up init_pages_in_zone()
From: Oscar Salvador <[email protected]>
Subject: mm/page_owner.c: clean up init_pages_in_zone()
Remove two redundant assignments in init_pages_in_zone().
[[email protected]: v3]
[[email protected]: coding style tweaks]
Signed-off-by Oscar Salvador <[email protected]>
Acked-by Michal Hocko <[email protected]>
Acked-by Vlastimil Babka <[email protected]>
Cc Joonsoo Kim <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/page_owner.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
mm/page_owner.c renamed from mm/page_owner.c~mm-page_owner-clean-up-init_pages_in_zone +4 -8
@@ -528,21 +528,18 @@ read_page_owner(struct file *file, charstatic void init_pages_in_zone (pg_data_t *pgdat,struct zone *zone) { -struct page *page; -struct page_ext *page_ext; -unsigned long pfn = zone->zone_start_pfn, block_end_pfn; -unsigned long end_pfn = pfn + zone->spanned_pages; +unsigned long pfn = zone->zone_start_pfn; +unsigned long end_pfn =zone_end_pfn (zone);unsigned long count =0 ; -/* Scan block by block. First and last block may be incomplete */ - pfn = zone->zone_start_pfn; -/* * Walk the zone in pageblock_nr_pages steps. If a page block spans * a zone boundary, it will be double counted between zones. This does * not matter as the mixed block count will still be correct */ for (; pfn < end_pfn; ) { +unsigned long block_end_pfn; +if (!pfn_valid (pfn)) { pfn =ALIGN (pfn +1 ,MAX_ORDER_NR_PAGES );continue ;
@@ -551,9 +548,10 @@ static void init_pages_in_zone(pg_data_t block_end_pfn =ALIGN (pfn +1 , pageblock_nr_pages); block_end_pfn =min (block_end_pfn, end_pfn); - page =pfn_to_page (pfn);