linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: Drop page-def.h
@ 2021-08-20  6:35 Anshuman Khandual
  2021-08-20  8:31 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Anshuman Khandual @ 2021-08-20  6:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, linux-kernel

PAGE_SHIFT (PAGE_SIZE and PAGE_MASK) which is derived from ARM64_PAGE_SHIFT
should be moved into pgtable-hwdef.h instead, and subsequently page-def.h
can be just dropped off completely.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on 5.14-rc6. Could move these definitions into <asm/page.h>
if that is preferred. But <asm/page-def.h> is neither really required as
a separate header nor is present on other platforms.

 arch/arm64/include/asm/memory.h        |  2 +-
 arch/arm64/include/asm/page-def.h      | 18 ------------------
 arch/arm64/include/asm/page.h          |  2 +-
 arch/arm64/include/asm/pgtable-hwdef.h |  4 ++++
 4 files changed, 6 insertions(+), 20 deletions(-)
 delete mode 100644 arch/arm64/include/asm/page-def.h

diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index 824a3655dd93..f987204c716a 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -12,7 +12,7 @@
 
 #include <linux/const.h>
 #include <linux/sizes.h>
-#include <asm/page-def.h>
+#include <asm/pgtable-hwdef.h>
 
 /*
  * Size of the PCI I/O space. This must remain a power of two so that
diff --git a/arch/arm64/include/asm/page-def.h b/arch/arm64/include/asm/page-def.h
deleted file mode 100644
index 2403f7b4cdbf..000000000000
--- a/arch/arm64/include/asm/page-def.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Based on arch/arm/include/asm/page.h
- *
- * Copyright (C) 1995-2003 Russell King
- * Copyright (C) 2017 ARM Ltd.
- */
-#ifndef __ASM_PAGE_DEF_H
-#define __ASM_PAGE_DEF_H
-
-#include <linux/const.h>
-
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT		CONFIG_ARM64_PAGE_SHIFT
-#define PAGE_SIZE		(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK		(~(PAGE_SIZE-1))
-
-#endif /* __ASM_PAGE_DEF_H */
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 993a27ea6f54..40313964d4b2 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -8,7 +8,7 @@
 #ifndef __ASM_PAGE_H
 #define __ASM_PAGE_H
 
-#include <asm/page-def.h>
+#include <asm/pgtable-hwdef.h>
 
 #ifndef __ASSEMBLY__
 
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index 40085e53f573..be8045080ebd 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -5,6 +5,10 @@
 #ifndef __ASM_PGTABLE_HWDEF_H
 #define __ASM_PGTABLE_HWDEF_H
 
+#define PAGE_SHIFT		CONFIG_ARM64_PAGE_SHIFT
+#define PAGE_SIZE		(_AC(1, UL) << PAGE_SHIFT)
+#define PAGE_MASK		(~(PAGE_SIZE-1))
+
 #include <asm/memory.h>
 
 /*
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64/mm: Drop page-def.h
  2021-08-20  6:35 [PATCH] arm64/mm: Drop page-def.h Anshuman Khandual
@ 2021-08-20  8:31 ` Will Deacon
  2021-08-20  8:52   ` Anshuman Khandual
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2021-08-20  8:31 UTC (permalink / raw)
  To: Anshuman Khandual; +Cc: linux-arm-kernel, Catalin Marinas, linux-kernel

On Fri, Aug 20, 2021 at 12:05:31PM +0530, Anshuman Khandual wrote:
> PAGE_SHIFT (PAGE_SIZE and PAGE_MASK) which is derived from ARM64_PAGE_SHIFT
> should be moved into pgtable-hwdef.h instead, and subsequently page-def.h
> can be just dropped off completely.

According to who?

Every other architecture defines PAGE_SHIFT in page.h, so if you're moving
things around then that sounds like a better choice.

Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64/mm: Drop page-def.h
  2021-08-20  8:31 ` Will Deacon
@ 2021-08-20  8:52   ` Anshuman Khandual
  0 siblings, 0 replies; 3+ messages in thread
From: Anshuman Khandual @ 2021-08-20  8:52 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-arm-kernel, Catalin Marinas, linux-kernel



On 8/20/21 2:01 PM, Will Deacon wrote:
> On Fri, Aug 20, 2021 at 12:05:31PM +0530, Anshuman Khandual wrote:
>> PAGE_SHIFT (PAGE_SIZE and PAGE_MASK) which is derived from ARM64_PAGE_SHIFT
>> should be moved into pgtable-hwdef.h instead, and subsequently page-def.h
>> can be just dropped off completely.
> 
> According to who?
> 
> Every other architecture defines PAGE_SHIFT in page.h, so if you're moving
> things around then that sounds like a better choice.

Sure, will change. That is why I had asked the question :)

> 
> Will
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-20  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20  6:35 [PATCH] arm64/mm: Drop page-def.h Anshuman Khandual
2021-08-20  8:31 ` Will Deacon
2021-08-20  8:52   ` Anshuman Khandual

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 NNTP newsgroup(s).