Skip to content
Commit fb054d0d authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds
Browse files

openrisc: prefer memblock APIs returning virtual address

Patch series "Refine memblock API", v2.

Current memblock API is quite extensive and, which is more annoying,
duplicated.  Except the low-level functions that allow searching for a
free memory region and marking it as reserved, memblock provides three
(well, two and a half) sets of functions to allocate memory.

There are several overlapping functions that return a physical address
and there are functions that return virtual address.  Those that return
the virtual address may also clear the allocated memory.  And, on top of
all that, some allocators panic and some return NULL in case of error.

This set tries to reduce the mess, and trim down the amount of memblock
allocation methods.

Patches 1-10 consolidate the functions that return physical address of
the allocated memory

Patches 11-13 are some trivial cleanups

Patches 14-19 add checks for the return value of memblock_alloc*() and
panics in case of errors.  The patches 14-18 include some minor
refactoring to have better readability of the resulting code and patch
19 is a mechanical addition of

	if (!ptr)
		panic();

after memblock_alloc*() calls.

And, finally, patches 20 and 21 remove panic() calls memblock and
_nopanic variants from memblock.

This patch (of 21):

The allocation of the page tables memory in openrics uses
memblock_phys_alloc() and then converts the returned physical address to
virtual one.  Use memblock_alloc_raw() and add a panic() if the
allocation fails.

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


Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Acked-by: default avatarStafford Horne <shorne@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Guo Ren <ren_guo@c-sky.com>				[c-sky]
Cc: Juergen Gross <jgross@suse.com>			[Xen]
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d5a572a4
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