Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4218203imm; Mon, 15 Oct 2018 10:58:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV62mhvx/1WgFhfZPxaSdyhWnUT9hrgJOlWAr+Xe4M3OJx3MpQB6iMs0NRe17Q16DKDOv4pxS X-Received: by 2002:a63:608c:: with SMTP id u134-v6mr16624245pgb.266.1539626315230; Mon, 15 Oct 2018 10:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539626315; cv=none; d=google.com; s=arc-20160816; b=BOLb7M+epanh8Nln9X1cKgbtgZI1ADJSpc20iGatarO7DqocuMxBnXwbO/C7WEOU6e 40jeTf1yhsjyiQOCtdEiFNIVkEn5pTB+vwCHFi3bE6syJPNJtYpJTXqWXpX7sJlT0KXY tIBl8TDS4bPTb4YZpBOUzVIpKDcqXYeJFwophzetWn+f+DlTNN0iaQnTFVilHAYI28ap zLcGGFFNbABcubBjqIlkE2MDGJpqgEjBYjwkDJxUP3FdEq3HypvmXi40upI7sTdtgnHP 0JaFnjzoS0qHnTNxYh3WTQ5pWyAtkC/r5BTmOD8Bqd+eJFfz8P3Qqa1K/EXijKttGNjs TBsw== 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=nw5kWWd1/hrUFCm6kbsf7HAyiHDlOYk1z2haRxYvOVGtWdfz+qrtOA/jXFMapAtOaz IO0Cbky++XYvbEMgQLerEKcO4reYWF3P+/ZD4YsFN7BtE6PqXxnKAGH239T8YCBce4p0 HHeGJVZP+pnHjEbkwkOL/7uBXSuwkHPobHiKdRN6OdGIlx/7p79PFkWMEAXRXfVxbyM5 IAAcFvWGeccfOAeo8gn2rc8wgNktXscKdRalVREvH1bQxc2U4n5Ep7UpEhbB7gOdt7+n L8R4cy/hZUlUCjA/fjMuKqZGn2GzqUTAFUv61Wn5ooATLVoE59gIw2wekMJhKClQR8Zs 0LvA== 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 m11-v6si10807275pgs.33.2018.10.15.10.58.19; Mon, 15 Oct 2018 10:58: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 S1727159AbeJPBnn (ORCPT + 99 others); Mon, 15 Oct 2018 21:43:43 -0400 Received: from ale.deltatee.com ([207.54.116.67]:54728 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbeJPBng (ORCPT ); Mon, 15 Oct 2018 21:43:36 -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 1gC77D-0002IK-Pi; Mon, 15 Oct 2018 11:57:18 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1gC779-0002Mg-AI; Mon, 15 Oct 2018 11:57:11 -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 , Andrew Morton , Arnd Bergmann , Logan Gunthorpe , Russell King , Kees Cook , Philip Derrin , "Steven Rostedt (VMware)" , Nicolas Pitre Date: Mon, 15 Oct 2018 11:56:59 -0600 Message-Id: <20181015175702.9036-4-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181015175702.9036-1-logang@deltatee.com> References: <20181015175702.9036-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, akpm@linux-foundation.org, arnd@arndb.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 v2 3/6] 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