@@ -631,9 +631,9 @@ void free_initmem(void)
#ifdef CONFIG_BLK_DEV_INITRD
-static int keep_initrd;
+static int __initdata keep_initrd;
-void free_initrd_mem(unsigned long start, unsigned long end)
+void __init free_initrd_mem(unsigned long start, unsigned long end)
{
if (!keep_initrd) {
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
@@ -330,9 +330,9 @@ void free_initmem(void)
#ifdef CONFIG_BLK_DEV_INITRD
-static int keep_initrd;
+static int __initdata keep_initrd;
-void free_initrd_mem(unsigned long start, unsigned long end)
+void __init free_initrd_mem(unsigned long start, unsigned long end)
{
if (!keep_initrd)
free_reserved_area((void *)start, (void *)end, 0, "initrd");
this patch change keep_initrd to __initdata section, and free_initrd_mem to __init section so that they can be freed by free_initmem, free_initrd_mem is only called by free_initrd function, so it's safe to free it after use. Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com> --- arch/arm/mm/init.c | 4 ++-- arch/arm64/mm/init.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)