diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-04-29 18:06:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:31 -0400 |
commit | d2309a1996dce1ea85b322a3dd36520493473494 (patch) | |
tree | 1d242a6c9dad14eec2fe220265026f521dd6990e /arch | |
parent | 7acb2c2e1c4391b58bf8e61efcd478cde5800ec1 (diff) |
mm/arc: use common help functions to free reserved pages
Use common help functions to free reserved pages.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/mm/init.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index caf797de23fc..727d4794ea0f 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c | |||
@@ -144,37 +144,18 @@ void __init mem_init(void) | |||
144 | PAGES_TO_KB(reserved_pages)); | 144 | PAGES_TO_KB(reserved_pages)); |
145 | } | 145 | } |
146 | 146 | ||
147 | static void __init free_init_pages(const char *what, unsigned long begin, | ||
148 | unsigned long end) | ||
149 | { | ||
150 | unsigned long addr; | ||
151 | |||
152 | pr_info("Freeing %s: %ldk [%lx] to [%lx]\n", | ||
153 | what, TO_KB(end - begin), begin, end); | ||
154 | |||
155 | /* need to check that the page we free is not a partial page */ | ||
156 | for (addr = begin; addr + PAGE_SIZE <= end; addr += PAGE_SIZE) { | ||
157 | ClearPageReserved(virt_to_page(addr)); | ||
158 | init_page_count(virt_to_page(addr)); | ||
159 | free_page(addr); | ||
160 | totalram_pages++; | ||
161 | } | ||
162 | } | ||
163 | |||
164 | /* | 147 | /* |
165 | * free_initmem: Free all the __init memory. | 148 | * free_initmem: Free all the __init memory. |
166 | */ | 149 | */ |
167 | void __init_refok free_initmem(void) | 150 | void __init_refok free_initmem(void) |
168 | { | 151 | { |
169 | free_init_pages("unused kernel memory", | 152 | free_initmem_default(0); |
170 | (unsigned long)__init_begin, | ||
171 | (unsigned long)__init_end); | ||
172 | } | 153 | } |
173 | 154 | ||
174 | #ifdef CONFIG_BLK_DEV_INITRD | 155 | #ifdef CONFIG_BLK_DEV_INITRD |
175 | void __init free_initrd_mem(unsigned long start, unsigned long end) | 156 | void __init free_initrd_mem(unsigned long start, unsigned long end) |
176 | { | 157 | { |
177 | free_init_pages("initrd memory", start, end); | 158 | free_reserved_area(start, end, 0, "initrd"); |
178 | } | 159 | } |
179 | #endif | 160 | #endif |
180 | 161 | ||