]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mm: simplify memblock numa node extraction
authorMark Rutland <mark.rutland@arm.com>
Wed, 22 Jun 2016 11:13:45 +0000 (12:13 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 27 Jun 2016 17:05:39 +0000 (18:05 +0100)
commit4c1782c813c1e4e7cf26cddb33bd8cc8f5142388
tree76e1edadbfa8ffea3cca536777bd047bbe15bd6c
parent83af3e818392db09c6a9e0443506481cf9f0565c
arm64: mm: simplify memblock numa node extraction

We currently open-code extracting the NUMA node of a memblock region,
which requires an ifdef to cater for !CONFIG_NUMA builds where the
memblock_region::nid field does not exist.

The generic memblock_get_region_node helper is intended to cater for
this. For CONFIG_HAVE_MEMBLOCK_NODE_MAP, builds this returns reg->nid,
and for for !CONFIG_HAVE_MEMBLOCK_NODE_MAP builds this is a static
inline that returns 0. Note that for arm64,
CONFIG_HAVE_MEMBLOCK_NODE_MAP is selected iff CONFIG_NUMA is.

This patch makes use of memblock_get_region_node to simplify the arm64
code. At the same time, we can move the nid variable definition into the
loop, as this is the only place it is used.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/init.c