From patchwork Mon Oct 15 17:57:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10642287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DE28109C for ; Mon, 15 Oct 2018 17:57:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F6B32984E for ; Mon, 15 Oct 2018 17:57:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 535A6298CA; Mon, 15 Oct 2018 17:57:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C23D12984E for ; Mon, 15 Oct 2018 17:57:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4E686B0006; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C24606B0007; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEC4D6B000C; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by kanga.kvack.org (Postfix) with ESMTP id 836986B0007 for ; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) Received: by mail-io1-f71.google.com with SMTP id m7-v6so19501466iop.9 for ; Mon, 15 Oct 2018 10:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:subject; bh=F3AcXnh1HyzAbBQ9lssNNroRP37cDvf3IpGQVMtb+Jw=; b=L8P8o0Vi9ZSnylqxhAZdA5QhbFNfyS+VyOWCeDky18jE7lG35XNxfrKI9rhGvcbDUP NPpwjQV/oWIcQ62nicnnou/DchbtMd9rtlpNTffxgMDiKHXxKro9IyJGpvVh5Yw4D3b0 1xkWA+SFhXALwyNK9sqJu1DPYANuMtR1FFyMhfPT4afa1Qb1ABJLV1jFpEysJ4uPPyvQ eh9rvTKG025N1hAoojtv2WJvPQYkAACzmeeGmGbtv+C+yhk0h+QOB0vZyyx0nHwrP/d3 /MueHkTTkeEsTo6h30l0ppo5cY0MpyYMYQrzLugtoxY7PKlloTTF/Q5fuo0QYt5MWGSm G2ww== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com X-Gm-Message-State: ABuFfog8plsmA1ZmmhTw4L2VN59bvzqAfvpfzN9v5zA+7m9C+Gvk22z1 rC5Z3MkiHq+gS1bq6ZtKJgt6sgBBnh21GjIvsPmIZpEgLd4JnRr1d3vAOakclnrGISHw24tNZH1 U4VATw5gOcjOc+nS/l62qSkcuQYh1ELzSwXTt0FlFQvI14qEYeacc914ArHOft1O5sg== X-Received: by 2002:a02:a087:: with SMTP id g7-v6mr14072154jah.92.1539626237290; Mon, 15 Oct 2018 10:57:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63MM6nhVTNmovNhiCjgLYGvoIkrieysByjFySTzKclbw6f2C3pB4qdfTRdk/CVr5jRsRz4W X-Received: by 2002:a02:a087:: with SMTP id g7-v6mr14072123jah.92.1539626236663; Mon, 15 Oct 2018 10:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539626236; cv=none; d=google.com; s=arc-20160816; b=mmFRORYplGwKCLlQLvJkcmLmLkEvDdwctw/73AnCjAL4JUL6yyyRZ1IAVlcTwOiAHC qH6YcJ6w9UpSaj0/PrZdh17Te9KaMCNci5SGLG4JvoznHTWlbMD1DoZxJIyv845TnrxN AO91gN/ETFbBfhF4CPYpgMeYvcBoRHvAJM2/C9XsNjuwJwX7sbpidLwDalcrUBov77Ma rvuULd7q34NonADSuFGcGD3toBk4MV9Et8q9bR6qpEdRzwjg8PPK63+dYzVHyrXMqcj7 9Nc2nYlKvwJYuSgii7KperPZ8nt4c7G74gj9IXfoKHnWzpOJGzul7sNmHnAypHNpztDG c0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:cc:to:from; bh=F3AcXnh1HyzAbBQ9lssNNroRP37cDvf3IpGQVMtb+Jw=; b=oFZn4rBrU/s3JC3/bi+PU4+tkz4IwMZFeaZ07L8uEwZPy5n3w4en8tE6KH2RCia8JQ qRi4tRPbTO2P/VsKwQY55IoY6PZG2jQQmss3nQZ3OKBQ5hsdMUaucuE28TtGWXM8XI+Y b6LrlOfG0FIR9OJNm1uj4NgafQvSrWBWqNdcEks3h/0rg68Eor1PE4g5JIZe2PJ0ukLI /lhjlPCj/2rggoxRLmnHcvAjqGBXT2JN9TMyGQkMv3NRw/T3MH/31KKW55VtRQ25xQ3t /VF/i6P2WPEGJ1WsH+mJFFt/mfuxm97gjMxIokdusEnBMa4el8z6yj7e3FX78sktruTD +Lpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com Received: from ale.deltatee.com (ale.deltatee.com. [207.54.116.67]) by mx.google.com with ESMTPS id g80-v6si8054459jae.116.2018.10.15.10.57.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 10:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) client-ip=207.54.116.67; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com 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 1gC77C-0002IL-7I; Mon, 15 Oct 2018 11:57:15 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1gC779-0002Mj-F4; 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 , Will Deacon Date: Mon, 15 Oct 2018 11:57:00 -0600 Message-Id: <20181015175702.9036-5-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 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, will.deacon@arm.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v2 4/6] arm64: 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Cleanup the arm64_memory_present() function seeing it's very similar to other arches. memblocks_present() is a direct replacement of arm64_memory_present() Signed-off-by: Logan Gunthorpe Acked-by: Catalin Marinas Cc: Will Deacon --- arch/arm64/mm/init.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 6a0b5c5a61af..c51a944fe19f 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -296,24 +296,6 @@ int pfn_valid(unsigned long pfn) EXPORT_SYMBOL(pfn_valid); #endif -#ifndef CONFIG_SPARSEMEM -static void __init arm64_memory_present(void) -{ -} -#else -static void __init arm64_memory_present(void) -{ - struct memblock_region *reg; - - for_each_memblock(memory, reg) { - int nid = memblock_get_region_node(reg); - - memory_present(nid, memblock_region_memory_base_pfn(reg), - memblock_region_memory_end_pfn(reg)); - } -} -#endif - static phys_addr_t memory_limit = PHYS_ADDR_MAX; /* @@ -506,7 +488,7 @@ void __init bootmem_init(void) * Sparsemem tries to allocate bootmem in memory_present(), so must be * done after the fixed reservations. */ - arm64_memory_present(); + memblocks_present(); sparse_init(); zone_sizes_init(min, max);