]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Improve init_resources()
authorNick Kossifidis <mick@ics.forth.gr>
Mon, 19 Apr 2021 00:55:37 +0000 (03:55 +0300)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Mon, 26 Apr 2021 15:25:22 +0000 (08:25 -0700)
commitc75f59eee01304cf6c91d08223adb916e486c984
treec954b603773d863c3198c0adde5e5c3e1ce27dc3
parent6bab032a4f17080ea509e5ad9739e00227010f10
RISC-V: Improve init_resources()

The kernel region is always present and we know where it is, no need to
look for it inside the loop, just ignore it like the rest of the
reserved regions within system's memory.

Additionally, we don't need to call memblock_free inside the loop, as if
called it'll split the region of pre-allocated resources in two parts,
messing things up, just re-use the previous pre-allocated resource and
free any unused resources after both loops finish.

Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
[Palmer: commit text]
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/setup.c