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

Commit 1aadc056 authored by Tejun Heo's avatar Tejun Heo
Browse files

memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users



The only function of memblock_analyze() is now allowing resize of
memblock region arrays.  Rename it to memblock_allow_resize() and
update its users.

* The following users remain the same other than renaming.

  arm/mm/init.c::arm_memblock_init()
  microblaze/kernel/prom.c::early_init_devtree()
  powerpc/kernel/prom.c::early_init_devtree()
  openrisc/kernel/prom.c::early_init_devtree()
  sh/mm/init.c::paging_init()
  sparc/mm/init_64.c::paging_init()
  unicore32/mm/init.c::uc32_memblock_init()

* In the following users, analyze was used to update total size which
  is no longer necessary.

  powerpc/kernel/machine_kexec.c::reserve_crashkernel()
  powerpc/kernel/prom.c::early_init_devtree()
  powerpc/mm/init_32.c::MMU_init()
  powerpc/mm/tlb_nohash.c::__early_init_mmu()  
  powerpc/platforms/ps3/mm.c::ps3_mm_add_memory()
  powerpc/platforms/embedded6xx/wii.c::wii_memory_fixups()
  sh/kernel/machine_kexec.c::reserve_crashkernel()

* x86/kernel/e820.c::memblock_x86_fill() was directly setting
  memblock_can_resize before populating memblock and calling analyze
  afterwards.  Call memblock_allow_resize() before start populating.

memblock_can_resize is now static inside memblock.c.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: "H. Peter Anvin" <hpa@zytor.com>
parent 1440c4e2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
	if (mdesc->reserve)
		mdesc->reserve();

	memblock_analyze();
	memblock_allow_resize();
	memblock_dump_all();
}

+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ void __init early_init_devtree(void *params)
	strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
	parse_early_param();

	memblock_analyze();
	memblock_allow_resize();

	pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size());

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ void __init early_init_devtree(void *params)
	/* Save command line for /proc/cmdline and then parse parameters */
	strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);

	memblock_analyze();
	memblock_allow_resize();

	/* We must copy the flattend device tree from init memory to regular
	 * memory because the device tree references the strings in it
+0 −3
Original line number Diff line number Diff line
@@ -107,9 +107,6 @@ void __init reserve_crashkernel(void)
	unsigned long long crash_size, crash_base;
	int ret;

	/* this is necessary because of memblock_phys_mem_size() */
	memblock_analyze();

	/* use common parsing */
	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
			&crash_size, &crash_base);
+1 −2
Original line number Diff line number Diff line
@@ -758,11 +758,10 @@ void __init early_init_devtree(void *params)
	 * Ensure that total memory size is page-aligned, because otherwise
	 * mark_bootmem() gets upset.
	 */
	memblock_analyze();
	limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
	memblock_enforce_memory_limit(limit);

	memblock_analyze();
	memblock_allow_resize();
	memblock_dump_all();

	DBG("Phys. mem: %llx\n", memblock_phys_mem_size());
Loading