Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp643709imm; Fri, 5 Oct 2018 09:23:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Lth6RyKwwUsNfFRyB+Rae7zKnVsOQ5waSz5RoZKVlOlVcuPurB0o0BGZLtd+JxsAxLHAV X-Received: by 2002:a63:c508:: with SMTP id f8-v6mr10975904pgd.412.1538756615458; Fri, 05 Oct 2018 09:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538756615; cv=none; d=google.com; s=arc-20160816; b=DtHojNqjtBGv+s62rDVKmb+rVTJaQdGD1qlaD0pJG7Hfxopad1jtq/MT/NNpU0D3KX 0b17eqdyRJIYb9P30PthiDb+r4Iay8iPAn3rfTLiZof192dFwgwPnpkgw08x0689QBN1 3m0OX9G2yAQiO2/8WKzOGRfbEhOXaOtKDgXj7VjBAvvGKspxcktGvPKYr5zDeNzukLCm tL+IeTECpTC2BlBVG/2kqNClblYVxxmXbKz8+u9J29rszBeHqlbg16KMXVkKI/c0LamU D8sdjZV6/i8+sSscuc//F6+6kCrgFRe1GlR0UM1hM3+CS1Z1butilsefPzg9Hux1RqgV 3o6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=Pjn2SKMH8bI3Nc5MBoKr+9lA/vWqKzACQOBqjOPOq7Y=; b=kjWw2tVy+ifcHUH+qUMrsSqSQabaQ3vBzdoIZ5fmDN0aHUnbBZXPxaPAawU4/IjwBK Ycpk/qAJI+yW4AALpISg4+zCrBmrOv+c1USB+3JQlS5HCwA6B71/dwmsYFnY0zcKYMKw kYFItEa7ae6MoQCe7aTSWHQlRQSTBXQzIkV6KFNrC/Hyf2S3J8USS/rM67MY+e4RUjZ7 6SAShbT3gf3dbRQkkfCP0FMfeCXAGNjOvZ3ZuGkLhdvbrbh94d9pVxtJ3WOSc8MlfZcK 0GbCnSaXFB6wuhAzzPND2k0UG5eJu/oZESxQZpS30E48v+QgutAnDkAUQvXssJM0prva LMGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si8699900plo.418.2018.10.05.09.23.20; Fri, 05 Oct 2018 09:23:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729566AbeJEXVv (ORCPT + 99 others); Fri, 5 Oct 2018 19:21:51 -0400 Received: from ale.deltatee.com ([207.54.116.67]:32894 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbeJEXQN (ORCPT ); Fri, 5 Oct 2018 19:16:13 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SmU-0008D3-Sl; Fri, 05 Oct 2018 10:16:49 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1g8SmS-0000ea-2I; Fri, 05 Oct 2018 10:16:44 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Cc: Stephen Bates , Palmer Dabbelt , Albert Ou , Christoph Hellwig , Logan Gunthorpe , Russell King , Kees Cook , Philip Derrin , "Steven Rostedt (VMware)" , Nicolas Pitre Date: Fri, 5 Oct 2018 10:16:39 -0600 Message-Id: <20181005161642.2462-3-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181005161642.2462-1-logang@deltatee.com> References: <20181005161642.2462-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, sbates@raithlin.com, palmer@sifive.com, aou@eecs.berkeley.edu, hch@lst.de, logang@deltatee.com, linux@armlinux.org.uk, keescook@chromium.org, philip@cog.systems, rostedt@goodmis.org, nicolas.pitre@linaro.org X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.1 Subject: [PATCH 2/5] ARM: mm: make use of new memblocks_present() helper X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanup the arm_memory_present() function seeing it's very similar to other arches. The new memblocks_present() helper checks for node ids which the arm version did not. However, this is equivalent seeing HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore memblock_get_region_node() should return 0. Signed-off-by: Logan Gunthorpe Cc: Russell King Cc: Kees Cook Cc: Philip Derrin Cc: "Steven Rostedt (VMware)" Cc: Nicolas Pitre --- arch/arm/mm/init.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0cc8e04295a4..e2710dd7446f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -201,21 +201,6 @@ int pfn_valid(unsigned long pfn) EXPORT_SYMBOL(pfn_valid); #endif -#ifndef CONFIG_SPARSEMEM -static void __init arm_memory_present(void) -{ -} -#else -static void __init arm_memory_present(void) -{ - struct memblock_region *reg; - - for_each_memblock(memory, reg) - memory_present(0, memblock_region_memory_base_pfn(reg), - memblock_region_memory_end_pfn(reg)); -} -#endif - static bool arm_memblock_steal_permitted = true; phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) @@ -317,7 +302,7 @@ void __init bootmem_init(void) * Sparsemem tries to allocate bootmem in memory_present(), * so must be done after the fixed reservations */ - arm_memory_present(); + memblocks_present(); /* * sparse_init() needs the bootmem allocator up and running. -- 2.19.0