]> www.infradead.org Git - users/jedix/linux-maple.git/commit
memblock: make memblock_find_in_range method private
authorMike Rapoport <rppt@linux.ibm.com>
Mon, 23 Aug 2021 23:59:36 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:16 +0000 (09:34 +1000)
commit461ef12c4375dbd898f21794f6087e0cd6353d35
tree8934838e3b371c77ff97c8f62b055b93a5a01b7a
parentbbc8c0f2b253b0e0767f3efcf9ca839bd70a9ea8
memblock: make memblock_find_in_range method private

There are a lot of uses of memblock_find_in_range() along with
memblock_reserve() from the times memblock allocation APIs did not exist.

memblock_find_in_range() is the very core of memblock allocations, so any
future changes to its internal behaviour would mandate updates of all the
users outside memblock.

Replace the calls to memblock_find_in_range() with an equivalent calls to
memblock_phys_alloc() and memblock_phys_alloc_range() and make
memblock_find_in_range() private method of memblock.

This simplifies the callers, ensures that (unlikely) errors in
memblock_reserve() are handled and improves maintainability of
memblock_find_in_range().

Link: https://lkml.kernel.org/r/20210816122622.30279-1-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> [arm64]
Acked-by: Kirill A. Shutemov <kirill.shtuemov@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ACPI]
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Nick Kossifidis <mick@ics.forth.gr> [riscv]
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
16 files changed:
arch/arm/kernel/setup.c
arch/arm64/kvm/hyp/reserved_mem.c
arch/arm64/mm/init.c
arch/mips/kernel/setup.c
arch/riscv/mm/init.c
arch/s390/kernel/setup.c
arch/x86/kernel/aperture_64.c
arch/x86/mm/init.c
arch/x86/mm/numa.c
arch/x86/mm/numa_emulation.c
arch/x86/realmode/init.c
drivers/acpi/tables.c
drivers/base/arch_numa.c
drivers/of/of_reserved_mem.c
include/linux/memblock.h
mm/memblock.c