From patchwork Thu May 14 17:03:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 11549371 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 286E290 for ; Thu, 14 May 2020 17:04:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D194120671 for ; Thu, 14 May 2020 17:04:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="atU5KbtJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D194120671 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EC047900151; Thu, 14 May 2020 13:04:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E70F98E0005; Thu, 14 May 2020 13:04:50 -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 D87ED900151; Thu, 14 May 2020 13:04:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id C1B738E0005 for ; Thu, 14 May 2020 13:04:50 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 72620181AEF10 for ; Thu, 14 May 2020 17:04:50 +0000 (UTC) X-FDA: 76815949140.22.coach75_8181366a2ab16 X-Spam-Summary: 2,0,0,b7f4a30e5b538bb7,d41d8cd98f00b204,rppt@kernel.org,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1542:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2904:3138:3139:3140:3141:3142:3354:3865:3866:3867:3870:4117:4321:4605:5007:6117:6119:6261:6653:6691:6742:6743:7576:7903:9036:10004:11026:11473:11657:11658:11914:12043:12296:12297:12517:12519:12555:12679:12895:12986:13894:14096:14181:14394:14721:21080:21324:21433:21451:21627:21990:30003:30054,0,RBL:198.145.29.99:@kernel.org:.lbl8.mailshell.net-64.100.201.201 62.2.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: coach75_8181366a2ab16 X-Filterd-Recvd-Size: 6177 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 May 2020 17:04:49 +0000 (UTC) Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 36882206DC; Thu, 14 May 2020 17:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589475889; bh=r0qA/m8aho5QyEwejC1WCC2ZRpWujFeBiVtRKwhabXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=atU5KbtJo1kgAvUKoSINwMB2SL+dOQJWNe4IlACMJxiJjl1WTuTl5iJ8m7MJnDyDw yxqD4xol3vTEUeqZo9MScwPsvWVMwy41lZ8rhAggIH8mQxL2GjjB5raD85BOM6tp4T INcD3dphNVZz3l0pngaw55A8PjFOkxbgN2/us6P4= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Arnd Bergmann , Borislav Petkov , Brian Cain , Catalin Marinas , Chris Zankel , "David S. Miller" , Geert Uytterhoeven , Greentime Hu , Greg Ungerer , Guan Xuetao , Guo Ren , Heiko Carstens , Helge Deller , Ingo Molnar , Ley Foon Tan , Mark Salter , Matthew Wilcox , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Nick Hu , Paul Walmsley , Richard Weinberger , Rich Felker , Russell King , Stafford Horne , Thomas Bogendoerfer , Thomas Gleixner , Tony Luck , Vincent Chen , Vineet Gupta , Will Deacon , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, x86@kernel.org, Mike Rapoport Subject: [PATCH v2 04/12] csky: replace definitions of __pXd_offset() with pXd_index() Date: Thu, 14 May 2020 20:03:19 +0300 Message-Id: <20200514170327.31389-5-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200514170327.31389-1-rppt@kernel.org> References: <20200514170327.31389-1-rppt@kernel.org> MIME-Version: 1.0 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: From: Mike Rapoport All architectures use pXd_index() to get an entry in the page table page corresponding to a virtual address. Align csky with other architectures. Signed-off-by: Mike Rapoport --- arch/csky/include/asm/pgtable.h | 5 ++--- arch/csky/mm/fault.c | 2 +- arch/csky/mm/highmem.c | 2 +- arch/csky/mm/init.c | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/csky/include/asm/pgtable.h b/arch/csky/include/asm/pgtable.h index 9d2d16db237d..2eff4aea51b3 100644 --- a/arch/csky/include/asm/pgtable.h +++ b/arch/csky/include/asm/pgtable.h @@ -229,9 +229,8 @@ static inline pte_t pte_mkyoung(pte_t pte) return pte; } -#define __pgd_offset(address) pgd_index(address) -#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) -#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) +#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) +#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c index 4e6dc68f3258..4055d430c0c8 100644 --- a/arch/csky/mm/fault.c +++ b/arch/csky/mm/fault.c @@ -78,7 +78,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, * Do _not_ use "tsk" here. We might be inside * an interrupt in the middle of a task switch.. */ - int offset = __pgd_offset(address); + int offset = pgd_index(address); pgd_t *pgd, *pgd_k; pud_t *pud, *pud_k; pmd_t *pmd, *pmd_k; diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c index 3b3f622f5ae9..89ec32e602a1 100644 --- a/arch/csky/mm/highmem.c +++ b/arch/csky/mm/highmem.c @@ -92,7 +92,7 @@ static void __init kmap_pages_init(void) vaddr = PKMAP_BASE; fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir); - pgd = swapper_pg_dir + __pgd_offset(vaddr); + pgd = swapper_pg_dir + pgd_index(vaddr); pud = (pud_t *)pgd; pmd = pmd_offset(pud, vaddr); pte = pte_offset_kernel(pmd, vaddr); diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c index eda2b4291485..af627128314f 100644 --- a/arch/csky/mm/init.c +++ b/arch/csky/mm/init.c @@ -157,9 +157,9 @@ void __init fixrange_init(unsigned long start, unsigned long end, unsigned long vaddr; vaddr = start; - i = __pgd_offset(vaddr); - j = __pud_offset(vaddr); - k = __pmd_offset(vaddr); + i = pgd_index(vaddr); + j = pud_index(vaddr); + k = pmd_index(vaddr); pgd = pgd_base + i; for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {