From patchwork Wed Jun 29 12:51:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 71187 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2134431qgy; Wed, 29 Jun 2016 05:53:20 -0700 (PDT) X-Received: by 10.66.193.231 with SMTP id hr7mr11638002pac.28.1467204800680; Wed, 29 Jun 2016 05:53:20 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id gh8si4329266pac.244.2016.06.29.05.53.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jun 2016 05:53:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIEyd-0005tk-8l; Wed, 29 Jun 2016 12:52:23 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIEyH-0005X4-Qi for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2016 12:52:02 +0000 Received: by mail-wm0-x231.google.com with SMTP id v199so179622886wmv.0 for ; Wed, 29 Jun 2016 05:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RXyYQMm/oGvzCPmy6YvB5WzvKTkO/S30BkibE61uDO4=; b=JZHpC9igUM8jFUDW1qX82tXhe3t65ePeUdzSr190SAtgsxgnTEqD+C4Jnh9IAl7DbT YiJbCYJr+L9JRfL0IGcHTewsxDoAg6DXc3D7S9W/KQBZvWVxt2MTj5Wz0EX5zAgwLeVQ LKnHuQ1oLjb6AnUzCfyksgD//dNWFEyprej2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RXyYQMm/oGvzCPmy6YvB5WzvKTkO/S30BkibE61uDO4=; b=XyPFlkb1CCGf8jj/gLaRs0dGZoqG1GqXtycCfBjH7Crb8JJ7MWST1rnfkGJODnmczW Wf5FIHgjM4GNyRCCV33oRecO6PMvLWRxWxDDorSyJANpVmXb7umf4x63DobiZyAadSB/ rxWjKIEEBHHq0EnDaq8yenjFdcSBYPE5elLJn5lVBuYqk1U7QdE27Tagvrl/xciUqIQe q9JciPZsr3Pn6jB5Vud/mPHSkOPlt8KAAwfjO6nsc600zs/FL50Oci11u4YbSKNTl3W5 BjSMKINGEBS3VcuwOlT90y24+ywkzPGD6O03vw3fOkZZSH3Grz9NDl0mgLY+d7/5T+uU LZng== X-Gm-Message-State: ALyK8tKM/Xrex4dC3JNzL+k4YNtIf7cpTby57hdgqEdP9h1inhmMBDm0XyUzzxKinWno9zHr X-Received: by 10.194.95.74 with SMTP id di10mr8484752wjb.52.1467204703887; Wed, 29 Jun 2016 05:51:43 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id bh7sm3592433wjb.22.2016.06.29.05.51.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jun 2016 05:51:43 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, matt@codeblueprint.co.uk Subject: [PATCH 5/5] arm64: mm: fold init_pgd() into __create_pgd_mapping() Date: Wed, 29 Jun 2016 14:51:30 +0200 Message-Id: <1467204690-10790-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467204690-10790-1-git-send-email-ard.biesheuvel@linaro.org> References: <1467204690-10790-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_055202_019943_EE4DFF3A X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:231 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The routine __create_pgd_mapping() does nothing except calling init_pgd(), which has no other callers. So fold the latter into the former. Also, drop a comment that has gone stale. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/mmu.c | 24 +++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f233c885042d..8cf4da36909a 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -240,16 +240,14 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, pud_clear_fixmap(); } -/* - * Create the page directory entries and any necessary page tables for the - * mapping specified by 'md'. - */ -static void init_pgd(pgd_t *pgd, phys_addr_t phys, unsigned long virt, - phys_addr_t size, pgprot_t prot, - phys_addr_t (*pgtable_alloc)(void), - bool allow_block_mappings) +static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys, + unsigned long virt, phys_addr_t size, + pgprot_t prot, + phys_addr_t (*pgtable_alloc)(void), + bool allow_block_mappings) { unsigned long addr, length, end, next; + pgd_t *pgd = pgd_offset_raw(pgdir, virt); /* * If the virtual and physical address don't have the same offset @@ -281,16 +279,6 @@ static phys_addr_t late_pgtable_alloc(void) return __pa(ptr); } -static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys, - unsigned long virt, phys_addr_t size, - pgprot_t prot, - phys_addr_t (*alloc)(void), - bool allow_block_mappings) -{ - init_pgd(pgd_offset_raw(pgdir, virt), phys, virt, size, prot, alloc, - allow_block_mappings); -} - /* * This function can only be used to modify existing table entries, * without allocating new levels of table. Note that this permits the