]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/avr32: use common help functions to free reserved pages
authorJiang Liu <liuj97@gmail.com>
Tue, 26 Mar 2013 23:24:23 +0000 (10:24 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:05 +0000 (17:12 +1100)
Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/avr32/mm/init.c

index 2798c2d4a1cf9c79e43df9df28378394d0cdd60a..e66e8406f99211ba17e28ae59b491c029aa5ace6 100644 (file)
@@ -146,34 +146,14 @@ void __init mem_init(void)
                initsize >> 10);
 }
 
-static inline void free_area(unsigned long addr, unsigned long end, char *s)
-{
-       unsigned int size = (end - addr) >> 10;
-
-       for (; addr < end; addr += PAGE_SIZE) {
-               struct page *page = virt_to_page(addr);
-               ClearPageReserved(page);
-               init_page_count(page);
-               free_page(addr);
-               totalram_pages++;
-       }
-
-       if (size && s)
-               printk(KERN_INFO "Freeing %s memory: %dK (%lx - %lx)\n",
-                      s, size, end - (size << 10), end);
-}
-
 void free_initmem(void)
 {
-       free_area((unsigned long)__init_begin, (unsigned long)__init_end,
-                 "init");
+       free_initmem_default(0);
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-       free_area(start, end, "initrd");
+       free_reserved_area(start, end, 0, "initrd");
 }
-
 #endif