Commit f348f5c2 authored by Mike Rapoport's avatar Mike Rapoport Committed by Max Filippov

xtensa: remove free_initrd_mem

The xtensa free_initrd_mem() verifies that initrd is mapped and then
frees its memory using free_reserved_area().

The initrd is considered mapped when its memory was successfully reserved
with mem_reserve().

Resetting initrd_start to 0 in case of mem_reserve() failure allows to
switch to generic free_initrd_mem() implementation.
Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Message-Id: <1563977432-8376-1-git-send-email-rppt@linux.ibm.com>
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent a55aa89a
...@@ -61,7 +61,6 @@ struct screen_info screen_info = { ...@@ -61,7 +61,6 @@ struct screen_info screen_info = {
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
extern unsigned long initrd_start; extern unsigned long initrd_start;
extern unsigned long initrd_end; extern unsigned long initrd_end;
int initrd_is_mapped = 0;
extern int initrd_below_start_ok; extern int initrd_below_start_ok;
#endif #endif
...@@ -332,13 +331,11 @@ void __init setup_arch(char **cmdline_p) ...@@ -332,13 +331,11 @@ void __init setup_arch(char **cmdline_p)
/* Reserve some memory regions */ /* Reserve some memory regions */
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start < initrd_end) { if (initrd_start < initrd_end &&
initrd_is_mapped = mem_reserve(__pa(initrd_start), !mem_reserve(__pa(initrd_start), __pa(initrd_end)))
__pa(initrd_end)) == 0;
initrd_below_start_ok = 1; initrd_below_start_ok = 1;
} else { else
initrd_start = 0; initrd_start = 0;
}
#endif #endif
mem_reserve(__pa(_stext), __pa(_end)); mem_reserve(__pa(_stext), __pa(_end));
......
...@@ -203,16 +203,6 @@ void __init mem_init(void) ...@@ -203,16 +203,6 @@ void __init mem_init(void)
(unsigned long)(__bss_stop - __bss_start) >> 10); (unsigned long)(__bss_stop - __bss_start) >> 10);
} }
#ifdef CONFIG_BLK_DEV_INITRD
extern int initrd_is_mapped;
void free_initrd_mem(unsigned long start, unsigned long end)
{
if (initrd_is_mapped)
free_reserved_area((void *)start, (void *)end, -1, "initrd");
}
#endif
static void __init parse_memmap_one(char *p) static void __init parse_memmap_one(char *p)
{ {
char *oldp; char *oldp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment