From patchwork Sun Nov 3 12:35:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 178375 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp246478ilf; Sun, 3 Nov 2019 04:37:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx0CQK5rrmWGNPFRQ/HkaLErZ0bqm1h7erke5qcYH8/Wf7xo6Zguv67rrO97yfV7SKnMeRC X-Received: by 2002:a17:906:af62:: with SMTP id os2mr11401504ejb.105.1572784669663; Sun, 03 Nov 2019 04:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572784669; cv=none; d=google.com; s=arc-20160816; b=bpF/5BpUmdCPPJlsHiie01laDQ7nWyfnDbMVUa9lAMkxf0UjH+zfb1xSAdpSecnh0y Kp6tb3j+V0Cy17ujisnzaQ2aGeTtyLsnXNAKVSTJ0zk6iU+2sfJ57g4TXEjx7ObUThTu D8QLB8GO6GVUVu2dd/GJbQ7q6FRoONwxnM8TMaVyBeeWWMYr/YtlyS5/fm/TdWDkAcKG N8ZgZxm16+McDaFboLzWfGPJ1Ey50F/T9yZmXxnoND4U5q4sL2MUP28vz7FRqBvsc81h L/G3fqJDfarxMjbMXloU7U5fOADVis5672iUUd2qPZAMdW+ZVqf5js8MyXTsz4gsrUgT 3t9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=iCIrgjy/jBJIf7jd88C0TplYGpd505IJ9u3iionPOJc=; b=JLohEt9BLQP9PewGoklR7ytO0ebzWfZb6hGL+7B8lUvJVmqxMXIvkMBrG8ku5U4xWD QVXuW02EurIMKxRl6RG8w7jBObKLaoni51iy52dOMXxcrKuYMPp4LFVptuEJGxq50fC7 UNvqz6EGPFspmEu7iTlQGxkQFbneTgAPLwZ4pQKBvJHYk1/1ZtIdgrNhh6cDmhih0r0R UHXwYWpdoMx+BoECoJIFLU0ww58oSHmCHR5XVlW7nwCdEp6+XDVZKjSLcyg3DYuN8Z08 Qp2JxyV9TbhLeSQH+NTey3lX9BlwCvFgGEwJB8xZLkPLPw79UuvIeBvKju4Y7LcuXOkX vzsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=k94a7PKg; 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 h10si6160803edj.451.2019.11.03.04.37.49; Sun, 03 Nov 2019 04:37:49 -0800 (PST) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=k94a7PKg; 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 S1727724AbfKCMhq (ORCPT + 26 others); Sun, 3 Nov 2019 07:37:46 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:48260 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbfKCMhp (ORCPT ); Sun, 3 Nov 2019 07:37:45 -0500 Received: from grover.flets-west.jp (softbank126021098169.bbtec.net [126.21.98.169]) (authenticated) by conuserg-12.nifty.com with ESMTP id xA3CaIVC018623; Sun, 3 Nov 2019 21:36:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com xA3CaIVC018623 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1572784579; bh=iCIrgjy/jBJIf7jd88C0TplYGpd505IJ9u3iionPOJc=; h=From:To:Cc:Subject:Date:From; b=k94a7PKgsuhGwzrYW+HBq+d1x8NxPSysqFdJPm243dZ4BqqhP0dVDEZ0UtIFzcnqT xEqRRE3szsW3yOb82Kc+ne5P2W+rFpq3a6uLw0feK2WsLlWZmoa/3s/M1QMgWUmbSX f+w8mATLjKjscOy0aV6inAfVfJcsM7vlfUobBihxLdvtK2M6eKM4Rau8UcGqq/vHhc sZeS5Elo3QaFRcvLNxyfzLMmBQSdlOCUpMbUZx36H0y5XD12krQKATfIbyZxlbgMVp DsQfTYH2QMzY2WQZDEsovfM9aYvaAdoaV6VlWpQ8cLG+1nvWqsbaDONTDVTtSb/KwF c93WuDR7Jvt2w== X-Nifty-SrcIP: [126.21.98.169] From: Masahiro Yamada To: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: Masahiro Yamada , Andrew Morton , Anshuman Khandual , Ard Biesheuvel , David Hildenbrand , Hsin-Yi Wang , Mark Rutland , Robin Murphy , Steve Capper , Thomas Gleixner , Yu Zhao , linux-kernel@vger.kernel.org Subject: [PATCH] arm64: mm: simplify the page end calculation in __create_pgd_mapping() Date: Sun, 3 Nov 2019 21:35:58 +0900 Message-Id: <20191103123559.8866-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Calculate the page-aligned end address more simply. The local variable, "length" is unneeded. Signed-off-by: Masahiro Yamada --- arch/arm64/mm/mmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Mark Rutland diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 60c929f3683b..a9f541912289 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -338,7 +338,7 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys, phys_addr_t (*pgtable_alloc)(int), int flags) { - unsigned long addr, length, end, next; + unsigned long addr, end, next; pgd_t *pgdp = pgd_offset_raw(pgdir, virt); /* @@ -350,9 +350,8 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys, phys &= PAGE_MASK; addr = virt & PAGE_MASK; - length = PAGE_ALIGN(size + (virt & ~PAGE_MASK)); + end = PAGE_ALIGN(virt + size); - end = addr + length; do { next = pgd_addr_end(addr, end); alloc_init_pud(pgdp, addr, next, phys, prot, pgtable_alloc,