From: Mike Rapoport <rppt@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Brian Cain <bcain@quicinc.com>,
"David S. Miller" <davem@davemloft.net>,
Dinh Nguyen <dinguyen@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Greg Ungerer <gerg@linux-m68k.org>, Guo Ren <guoren@kernel.org>,
Helge Deller <deller@gmx.de>, Huacai Chen <chenhuacai@kernel.org>,
Matt Turner <mattst88@gmail.com>,
Max Filippov <jcmvbkbc@gmail.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Michal Simek <monstr@monstr.eu>,
Palmer Dabbelt <palmer@dabbelt.com>,
Rich Felker <dalias@libc.org>,
Richard Weinberger <richard@nod.at>,
Russell King <linux@armlinux.org.uk>,
Stafford Horne <shorne@gmail.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Vineet Gupta <vgupta@kernel.org>, WANG Xuerui <kernel@xen0n.name>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org,
linux-arm-kernel@list
Subject: [PATCH v2 2/4] m68k: use asm-generic/memory_model.h for both MMU and !MMU
Date: Sun, 29 Jan 2023 14:42:33 +0200 [thread overview]
Message-ID: <20230129124235.209895-3-rppt@kernel.org> (raw)
In-Reply-To: <20230129124235.209895-1-rppt@kernel.org>
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
The MMU variant uses generic definitions of page_to_pfn() and
pfn_to_page(), but !MMU defines them in include/asm/page_no.h for no
good reason.
Include asm-generic/memory_model.h in the common include/asm/page.h and
drop redundant definitions.
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/include/asm/page.h | 6 +-----
arch/m68k/include/asm/page_mm.h | 1 -
arch/m68k/include/asm/page_no.h | 2 --
3 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index 2f1c54e4725d..a5993ad83ed8 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -62,11 +62,7 @@ extern unsigned long _ramend;
#include <asm/page_no.h>
#endif
-#ifndef CONFIG_MMU
-#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
-#define __pfn_to_phys(pfn) PFN_PHYS(pfn)
-#endif
-
#include <asm-generic/getorder.h>
+#include <asm-generic/memory_model.h>
#endif /* _M68K_PAGE_H */
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index a5b459bcb7d8..3903db2e8da7 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -134,7 +134,6 @@ extern int m68k_virt_to_node_shift;
})
#define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT)
-#include <asm-generic/memory_model.h>
#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index c9d0d84158a4..0a8ccef777fd 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -26,8 +26,6 @@ extern unsigned long memory_end;
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
#define page_to_virt(page) __va(((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET))
-#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
-#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \
--
2.35.1
next prev parent reply other threads:[~2023-01-29 12:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 12:42 [PATCH v2 0/4] mm, arch: add generic implementation of pfn_valid() for FLATMEM Mike Rapoport
2023-01-29 12:42 ` [PATCH v2 1/4] arm: include asm-generic/memory_model.h from page.h rather than memory.h Mike Rapoport
2023-02-03 14:30 ` David Hildenbrand
2023-01-29 12:42 ` Mike Rapoport [this message]
2023-02-03 14:31 ` [PATCH v2 2/4] m68k: use asm-generic/memory_model.h for both MMU and !MMU David Hildenbrand
2023-02-12 17:35 ` Guenter Roeck
2023-02-13 1:15 ` Mike Rapoport
2023-02-13 6:25 ` Guenter Roeck
2023-01-29 12:42 ` [PATCH v2 3/4] mips: drop definition of pfn_valid() for DISCONTIGMEM Mike Rapoport
2023-02-03 14:31 ` David Hildenbrand
2023-01-29 12:42 ` [PATCH v2 4/4] mm, arch: add generic implementation of pfn_valid() for FLATMEM Mike Rapoport
2023-01-30 5:06 ` Michael Ellerman
2023-01-31 17:47 ` Conor Dooley
2023-01-31 18:41 ` Mike Rapoport
2023-01-31 18:55 ` Conor Dooley
2023-02-03 14:33 ` David Hildenbrand
2023-02-12 16:13 ` Guenter Roeck
2023-02-12 16:26 ` Mike Rapoport
2023-02-12 17:38 ` Guenter Roeck
2023-02-13 1:26 ` Mike Rapoport
2023-02-13 6:37 ` Guenter Roeck
2023-02-13 7:54 ` 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=20230129124235.209895-3-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bcain@quicinc.com \
--cc=chenhuacai@kernel.org \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=dinguyen@kernel.org \
--cc=geert@linux-m68k.org \
--cc=gerg@linux-m68k.org \
--cc=guoren@kernel.org \
--cc=jcmvbkbc@gmail.com \
--cc=kernel@xen0n.name \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@list \
--cc=linux@armlinux.org.uk \
--cc=mattst88@gmail.com \
--cc=monstr@monstr.eu \
--cc=mpe@ellerman.id.au \
--cc=palmer@dabbelt.com \
--cc=richard@nod.at \
--cc=shorne@gmail.com \
--cc=tsbogend@alpha.franken.de \
--cc=vgupta@kernel.org \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).