Skip to content

Commit 5d3f410

Browse files
davidhildenbrandguoren83
authored andcommitted
csky: use free_initmem_default() in free_initmem()
The existing code is essentially free_initmem_default()->free_reserved_area() without poisoning. Note that existing code missed to update the managed page count of the zone. Cc: Andrew Morton <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Wei Yang <[email protected]> Tested-by: Guo Ren <[email protected]> Signed-off-by: Guo Ren <[email protected]> Signed-off-by: David Hildenbrand <[email protected]>
1 parent c47e1a1 commit 5d3f410

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

arch/csky/mm/init.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,9 @@ void __init mem_init(void)
110110
mem_init_print_info(NULL);
111111
}
112112

113-
extern char __init_begin[], __init_end[];
114-
115113
void free_initmem(void)
116114
{
117-
unsigned long addr;
118-
119-
addr = (unsigned long) &__init_begin;
120-
121-
while (addr < (unsigned long) &__init_end) {
122-
ClearPageReserved(virt_to_page(addr));
123-
init_page_count(virt_to_page(addr));
124-
free_page(addr);
125-
totalram_pages_inc();
126-
addr += PAGE_SIZE;
127-
}
128-
129-
pr_info("Freeing unused kernel memory: %dk freed\n",
130-
((unsigned int)&__init_end - (unsigned int)&__init_begin) >> 10);
115+
free_initmem_default(-1);
131116
}
132117

133118
void pgd_init(unsigned long *p)

0 commit comments

Comments
 (0)