[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27ffa400-b947-7c83-0e79-c8eb9f96e12e@xen0n.name>
Date: Tue, 18 Oct 2022 17:20:19 +0800
From: WANG Xuerui <kernel@...0n.name>
To: Kefeng Wang <wangkefeng.wang@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-snps-arc@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
linux-hexagon@...r.kernel.org, linux-ia64@...r.kernel.org,
loongarch@...ts.linux.dev, linux-m68k@...ts.linux-m68k.org,
linux-mips@...r.kernel.org, openrisc@...ts.librecores.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
linux-um@...ts.infradead.org, linux-xtensa@...ux-xtensa.org,
linux-fsdevel@...r.kernel.org
Cc: Richard Henderson <richard.henderson@...aro.org>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Vineet Gupta <vgupta@...nel.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Guo Ren <guoren@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Greg Ungerer <gerg@...ux-m68k.org>,
Michal Simek <monstr@...str.eu>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Dinh Nguyen <dinguyen@...nel.org>,
Jonas Bonn <jonas@...thpole.se>,
Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
Stafford Horne <shorne@...il.com>,
"James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
Helge Deller <deller@....de>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
"David S . Miller" <davem@...emloft.net>,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>
Subject: Re: [PATCH] mm: remove kern_addr_valid() completely
On 2022/10/18 15:40, Kefeng Wang wrote:
> Most architectures(except arm64/x86/sparc) simply return 1 for
one space before the opening parens
> kern_addr_valid(), which is only used in read_kcore(), and it
> calls copy_from_kernel_nofault() which could check whether the
> address is a valid kernel address, so no need kern_addr_valid(),
minor grammatical nit:
"... which already checks whether the address is a valid kernel address.
So kern_addr_valid is unnecessary, let's remove it."
> let's remove unneeded kern_addr_valid() completely.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
> arch/alpha/include/asm/pgtable.h | 2 -
> arch/arc/include/asm/pgtable-bits-arcv2.h | 2 -
> arch/arm/include/asm/pgtable-nommu.h | 2 -
> arch/arm/include/asm/pgtable.h | 4 --
> arch/arm64/include/asm/pgtable.h | 2 -
> arch/arm64/mm/mmu.c | 47 -----------------------
> arch/arm64/mm/pageattr.c | 3 +-
> arch/csky/include/asm/pgtable.h | 3 --
> arch/hexagon/include/asm/page.h | 7 ----
> arch/ia64/include/asm/pgtable.h | 16 --------
> arch/loongarch/include/asm/pgtable.h | 2 -
> arch/m68k/include/asm/pgtable_mm.h | 2 -
> arch/m68k/include/asm/pgtable_no.h | 1 -
> arch/microblaze/include/asm/pgtable.h | 3 --
> arch/mips/include/asm/pgtable.h | 2 -
> arch/nios2/include/asm/pgtable.h | 2 -
> arch/openrisc/include/asm/pgtable.h | 2 -
> arch/parisc/include/asm/pgtable.h | 15 --------
> arch/powerpc/include/asm/pgtable.h | 7 ----
> arch/riscv/include/asm/pgtable.h | 2 -
> arch/s390/include/asm/pgtable.h | 2 -
> arch/sh/include/asm/pgtable.h | 2 -
> arch/sparc/include/asm/pgtable_32.h | 6 ---
> arch/sparc/mm/init_32.c | 3 +-
> arch/sparc/mm/init_64.c | 1 -
> arch/um/include/asm/pgtable.h | 2 -
> arch/x86/include/asm/pgtable_32.h | 9 -----
> arch/x86/include/asm/pgtable_64.h | 1 -
> arch/x86/mm/init_64.c | 41 --------------------
> arch/xtensa/include/asm/pgtable.h | 2 -
> fs/proc/kcore.c | 26 +++++--------
> 31 files changed, 11 insertions(+), 210 deletions(-)
>
> diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h
> index 946704bee599..fc70b7041b76 100644
> --- a/arch/loongarch/include/asm/pgtable.h
> +++ b/arch/loongarch/include/asm/pgtable.h
> @@ -421,8 +421,6 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
> __update_tlb(vma, address, (pte_t *)pmdp);
> }
>
> -#define kern_addr_valid(addr) (1)
> -
> static inline unsigned long pmd_pfn(pmd_t pmd)
> {
> return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
Acked-by: WANG Xuerui <git@...0n.name> # loongarch
Thanks!
--
WANG "xen0n" Xuerui
Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/
Powered by blists - more mailing lists