From: catalin.marinas@arm.com (Catalin Marinas) Date: Mon, 27 Jun 2016 18:06:07 +0100 Subject: [PATCH] arm64: mm: simplify memblock numa node extraction In-Reply-To: <1466594025-27682-1-git-send-email-mark.rutland@arm.com> References: <1466594025-27682-1-git-send-email-mark.rutland@arm.com> Message-ID: <20160627170606.GE6847@e104818-lin.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jun 22, 2016 at 12:13:45PM +0100, Mark Rutland wrote: > 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 > Reviewed-by: Steve Capper > Cc: Catalin Marinas > Cc: Will Deacon Applied. Thanks. -- Catalin