Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 997aef68 authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds
Browse files

init: provide a generic free_initmem implementation

Patch series "provide a generic free_initmem implementation", v2.

Many architectures implement free_initmem() in exactly the same or very
similar way: they wrap the call to free_initmem_default() with sometimes
different 'poison' parameter.

These patches switch those architectures to use a generic implementation
that does free_initmem_default(POISON_FREE_INITMEM).

This was inspired by Christoph's patches for free_initrd_mem [1] and I
shamelessly copied changelog entries from his patches :)

[1] https://lore.kernel.org/lkml/20190213174621.29297-1-hch@lst.de/

This patch (of 2):

For most architectures free_initmem just a wrapper for the same
free_initmem_default(-1) call.  Provide that as a generic implementation
marked __weak.

Link: http://lkml.kernel.org/r/1550515285-17446-2-git-send-email-rppt@linux.ibm.com


Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f94f7434
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -285,9 +285,3 @@ mem_init(void)
	memblock_free_all();
	mem_init_print_info(NULL);
}

void
free_initmem(void)
{
	free_initmem_default(-1);
}
+0 −8
Original line number Diff line number Diff line
@@ -206,11 +206,3 @@ void __init mem_init(void)
	memblock_free_all();
	mem_init_print_info(NULL);
}

/*
 * free_initmem: Free all the __init memory.
 */
void __ref free_initmem(void)
{
	free_initmem_default(-1);
}
+0 −5
Original line number Diff line number Diff line
@@ -68,8 +68,3 @@ void __init mem_init(void)

	mem_init_print_info(NULL);
}

void __init free_initmem(void)
{
	free_initmem_default(-1);
}
+0 −6
Original line number Diff line number Diff line
@@ -102,9 +102,3 @@ void __init mem_init(void)

	mem_init_print_info(NULL);
}

void
free_initmem(void)
{
	free_initmem_default(-1);
}
+0 −5
Original line number Diff line number Diff line
@@ -186,11 +186,6 @@ void __init setup_memory(void)
	paging_init();
}

void free_initmem(void)
{
	free_initmem_default(-1);
}

void __init mem_init(void)
{
	high_memory = (void *)__va(memory_start + lowmem_size - 1);
Loading