]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/SPARC: use free_highmem_page() to free highmem pages into buddy system
authorJiang Liu <liuj97@gmail.com>
Wed, 20 Mar 2013 04:07:20 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:22:47 +0000 (15:22 +1100)
Use helper function free_highmem_page() to free highmem pages into
the buddy system.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sparc/mm/init_32.c

index 13d6fee3ff44963f9a9318042f16678eaf433f17..af472cf7c69a1998ab1b16dcba9edb884ef7e743 100644 (file)
@@ -282,14 +282,8 @@ static void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
        printk("mapping high region %08lx - %08lx\n", start_pfn, end_pfn);
 #endif
 
-       for (tmp = start_pfn; tmp < end_pfn; tmp++) {
-               struct page *page = pfn_to_page(tmp);
-
-               ClearPageReserved(page);
-               init_page_count(page);
-               __free_page(page);
-               totalhigh_pages++;
-       }
+       for (tmp = start_pfn; tmp < end_pfn; tmp++)
+               free_highmem_page(pfn_to_page(tmp));
 }
 
 void __init mem_init(void)
@@ -347,8 +341,6 @@ void __init mem_init(void)
                map_high_region(start_pfn, end_pfn);
        }
        
-       totalram_pages += totalhigh_pages;
-
        codepages = (((unsigned long) &_etext) - ((unsigned long)&_start));
        codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT;
        datapages = (((unsigned long) &_edata) - ((unsigned long)&_etext));