Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2819228ybx; Sun, 3 Nov 2019 04:39:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwu1ECFr70LPlOU0mGLQKcQeVJ36WNTwwFL47hpsz0OSwWmjgK4J0IwpMErmXEoqtmrZMCf X-Received: by 2002:a17:906:27ce:: with SMTP id k14mr18914357ejc.72.1572784772860; Sun, 03 Nov 2019 04:39:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572784772; cv=none; d=google.com; s=arc-20160816; b=HejUaZdguQuadghKybXT9XGqmqgh1WBL1sFarVzLZ/OeIFazEWYW8klsNSg60ZJf1W twg+x2m5G3kQT3RzJGgLIvCRJ2ubHOWyBC13QagF4t8l5FBGgbk+lxVJFY6kNo2GC2KM Pw6K/luJxzDCDxzb9LwbHh3laiKJt4oZCfYpTbkh2h5ciQLOPtoJbRtkbbFezHHKCEQz jHFKuCKqK/ZPgutj7Xuzs3eBIYSFKVf1YMpzae+ZgxMlcV8hvNqaMbAAefYhmQvty5Ua jj58gd0vYb9XdobkZqxzJYjlsvb1zbV5wGpCd4sQyhzlLJOOFskXC3IosFYe64yJF9Ve mgUw== 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 17si9480823ejt.419.2019.11.03.04.39.09; Sun, 03 Nov 2019 04:39:32 -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 S1727710AbfKCMhp (ORCPT + 99 others); Sun, 3 Nov 2019 07:37:45 -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(-) 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, -- 2.17.1