From: Mike Rapoport <rppt@kernel•org>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: Rich Felker <dalias@libc•org>,
linux-ia64@vger•kernel.org,
Geert Uytterhoeven <geert+renesas@glider•be>,
linux-sh@vger•kernel.org,
Benjamin Herrenschmidt <benh@kernel•crashing.org>,
linux-mm@kvack•org, Paul Mackerras <paulus@samba•org>,
linux-hexagon@vger•kernel.org, Will Deacon <will@kernel•org>,
kvmarm@lists•cs.columbia.edu, Jonas Bonn <jonas@southpole•se>,
linux-arch@vger•kernel.org, Brian Cain <bcain@codeaurora•org>,
Marc Zyngier <maz@kernel•org>,
Russell King <linux@armlinux•org.uk>,
Ley Foon Tan <ley.foon.tan@intel•com>,
Mike Rapoport <rppt@linux•ibm.com>,
Catalin Marinas <catalin.marinas@arm•com>,
Julien Thierry <julien.thierry.kdev@gmail•com>,
uclinux-h8-devel@lists•sourceforge.jp,
Fenghua Yu <fenghua.yu@intel•com>, Arnd Bergmann <arnd@arndb•de>,
Suzuki K Poulose <suzuki.poulose@arm•com>,
kvm-ppc@vger•kernel.org,
Stefan Kristiansson <stefan.kristiansson@saunalahti•fi>,
openrisc@lists•librecores.org, Stafford Horne <shorne@gmail•com>,
Guan Xuetao <gxt@pku•edu.cn>,
linux-arm-kernel@lists•infradead.org,
Christophe Leroy <christophe.leroy@c-s•fr>,
Tony Luck <tony.luck@intel•com>,
Yoshinori Sato <ysato@users•sourceforge.jp>,
linux-kernel@vger•kernel.org, James Morse <james.morse@arm•com>,
Michael Ellerman <mpe@ellerman•id.au>,
nios2-dev@lists•rocketboards.org, linuxppc-dev@lists•ozlabs.org,
Mike Rapoport <rppt@kernel•org>
Subject: [PATCH v4 10/14] sh: drop __pXd_offset() macros that duplicate pXd_index() ones
Date: Tue, 14 Apr 2020 18:34:51 +0300 [thread overview]
Message-ID: <20200414153455.21744-11-rppt@kernel.org> (raw)
In-Reply-To: <20200414153455.21744-1-rppt@kernel.org>
From: Mike Rapoport <rppt@linux•ibm.com>
The __pXd_offset() macros are identical to the pXd_index() macros and there
is no point to keep both of them. All architectures define and use
pXd_index() so let's keep only those to make mips consistent with the rest
of the kernel.
Signed-off-by: Mike Rapoport <rppt@linux•ibm.com>
---
arch/sh/include/asm/pgtable_32.h | 5 ++---
arch/sh/include/asm/pgtable_64.h | 5 ++---
arch/sh/mm/init.c | 6 +++---
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h
index 29274f0e428e..4acce5f2cbf9 100644
--- a/arch/sh/include/asm/pgtable_32.h
+++ b/arch/sh/include/asm/pgtable_32.h
@@ -407,13 +407,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
/* to find an entry in a page-table-directory. */
#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
-#define __pgd_offset(address) pgd_index(address)
/* to find an entry in a kernel page-table-directory */
#define pgd_offset_k(address) pgd_offset(&init_mm, 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))
/* Find an entry in the third-level page table.. */
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
diff --git a/arch/sh/include/asm/pgtable_64.h b/arch/sh/include/asm/pgtable_64.h
index 1778bc5971e7..27cc282ec6c0 100644
--- a/arch/sh/include/asm/pgtable_64.h
+++ b/arch/sh/include/asm/pgtable_64.h
@@ -46,14 +46,13 @@ static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
/* To find an entry in a generic PGD. */
#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define __pgd_offset(address) pgd_index(address)
#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
/* To find an entry in a kernel PGD. */
#define pgd_offset_k(address) pgd_offset(&init_mm, 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)) */
/*
* PMD level access routines. Same notes as above.
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index b9de2d4fa57e..f445ba630790 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -172,9 +172,9 @@ void __init page_table_range_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++) {
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-04-14 15:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 15:34 [PATCH v4 00/14] mm: remove __ARCH_HAS_5LEVEL_HACK Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 01/14] h8300: remove usage of __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 02/14] arm: add support for folded p4d page tables Mike Rapoport
2020-05-07 12:16 ` Marek Szyprowski
2020-05-07 16:11 ` Mike Rapoport
2020-05-08 6:53 ` Marek Szyprowski
2020-05-08 17:42 ` Mike Rapoport
2020-05-11 6:36 ` Marek Szyprowski
2020-05-11 14:15 ` Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 03/14] arm64: " Mike Rapoport
2020-05-15 18:40 ` Andrew Morton
2020-05-16 17:20 ` Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 04/14] hexagon: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 05/14] ia64: add support for folded p4d page tables Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 06/14] nios2: " Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 07/14] openrisc: " Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 08/14] powerpc: " Mike Rapoport
2020-06-03 19:05 ` Andrew Morton
2020-06-04 9:50 ` Qian Cai
2020-04-14 15:34 ` [PATCH v4 09/14] sh: fault: Modernize printing of kernel messages Mike Rapoport
2020-04-14 15:34 ` Mike Rapoport [this message]
2020-04-14 15:34 ` [PATCH v4 11/14] sh: add support for folded p4d page tables Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 12/14] unicore32: remove __ARCH_USE_5LEVEL_HACK Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 13/14] asm-generic: remove pgtable-nop4d-hack.h Mike Rapoport
2020-04-14 15:34 ` [PATCH v4 14/14] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200414153455.21744-11-rppt@kernel.org \
--to=rppt@kernel$(echo .)org \
--cc=akpm@linux-foundation$(echo .)org \
--cc=arnd@arndb$(echo .)de \
--cc=bcain@codeaurora$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=christophe.leroy@c-s$(echo .)fr \
--cc=dalias@libc$(echo .)org \
--cc=fenghua.yu@intel$(echo .)com \
--cc=geert+renesas@glider$(echo .)be \
--cc=gxt@pku$(echo .)edu.cn \
--cc=james.morse@arm$(echo .)com \
--cc=jonas@southpole$(echo .)se \
--cc=julien.thierry.kdev@gmail$(echo .)com \
--cc=kvm-ppc@vger$(echo .)kernel.org \
--cc=kvmarm@lists$(echo .)cs.columbia.edu \
--cc=ley.foon.tan@intel$(echo .)com \
--cc=linux-arch@vger$(echo .)kernel.org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-hexagon@vger$(echo .)kernel.org \
--cc=linux-ia64@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-sh@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=maz@kernel$(echo .)org \
--cc=mpe@ellerman$(echo .)id.au \
--cc=nios2-dev@lists$(echo .)rocketboards.org \
--cc=openrisc@lists$(echo .)librecores.org \
--cc=paulus@samba$(echo .)org \
--cc=rppt@linux$(echo .)ibm.com \
--cc=shorne@gmail$(echo .)com \
--cc=stefan.kristiansson@saunalahti$(echo .)fi \
--cc=suzuki.poulose@arm$(echo .)com \
--cc=tony.luck@intel$(echo .)com \
--cc=uclinux-h8-devel@lists$(echo .)sourceforge.jp \
--cc=will@kernel$(echo .)org \
--cc=ysato@users$(echo .)sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox