Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Mike Rapoport <rppt@xxxxxxxxxx>
- Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM
- From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Jan 2023 17:45:12 -0800
- Cc: Arnd Bergmann <arnd@xxxxxxxx>, Brian Cain <bcain@xxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Dinh Nguyen <dinguyen@xxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greg Ungerer <gerg@xxxxxxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxx>, WANG Xuerui <kernel@xxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux--csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx
- In-reply-to: <20230125190757.22555-4-rppt@kernel.org>
- References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org>
On Wed, 25 Jan 2023 21:07:57 +0200 Mike Rapoport <rppt@xxxxxxxxxx> wrote:
> Every architecture that supports FLATMEM memory model defines its own
> version of pfn_valid() that essentially compares a pfn to max_mapnr.
>
> Use mips/powerpc version implemented as static inline as a generic
> implementation of pfn_valid() and drop its per-architecture definitions
arm allnoconfig:
./include/asm-generic/memory_model.h:23:19: error: static declaration of 'pfn_valid' follows non-static declaration
23 | static inline int pfn_valid(unsigned long pfn)
| ^~~~~~~~~
./arch/arm/include/asm/page.h:160:12: note: previous declaration of 'pfn_valid' with type 'int(long unsigned int)'
160 | extern int pfn_valid(unsigned long);
| ^~~~~~~~~
I thought of doing
--- a/arch/arm/include/asm/page.h~mm-arch-add-generic-implementation-of-pfn_valid-for-flatmem-fix
+++ a/arch/arm/include/asm/page.h
@@ -156,10 +156,6 @@ extern void copy_page(void *to, const vo
typedef struct page *pgtable_t;
-#ifdef CONFIG_HAVE_ARCH_PFN_VALID
-extern int pfn_valid(unsigned long);
-#endif
-
#include <asm/memory.h>
#endif /* !__ASSEMBLY__ */
_
but I'm seeing a pfn_valid declaration in arch/arc/include/asm/page.h
which might be a problem.
v2, please ;)
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]