init: provide a generic free_initmem implementation
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 14 May 2019 00:18:40 +0000 (17:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 May 2019 16:47:47 +0000 (09:47 -0700)
commit997aef68af3ef1f2cb97da1c0b41a5afa87f63e2
tree3abeb4f6d3dd24b804cbf1474fe606fc8c67a537
parentf94f7434cbbb02f7eb55ed5ad66284023c47968f
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: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Andrew 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 files changed:
arch/alpha/mm/init.c
arch/arc/mm/init.c
arch/c6x/mm/init.c
arch/h8300/mm/init.c
arch/microblaze/mm/init.c
arch/nds32/mm/init.c
arch/nios2/mm/init.c
arch/openrisc/mm/init.c
arch/sh/mm/init.c
arch/unicore32/mm/init.c
arch/xtensa/mm/init.c
init/main.c