arm/mm: Drop [PTE|PMD]_TYPE_FAULT
PATCH 1/1 arm/mm: Drop [PTE|PMD]_TYPE_FAULT
Drop these unused symbols i.e PTE_TYPE_FAULT and PMD_TYPE_FAULT.
---
Applies on latest mainline. Just found this by code inspection and built tested for arm platform. Posted this earlier as well but some how got missed.
https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
arch/arm/include/asm/pgtable-2level-hwdef.h | 2 -- arch/arm/include/asm/pgtable-3level-hwdef.h | 2 -- 2 files changed, 4 deletions(-)
arch/arm/include/asm/pgtable-2level-hwdef.h +0 -2
@@ -14,7 +14,6 @@* - common */ #define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0) -#define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)#define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0)#define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0)#define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2)/* v7 */
@@ -56,7 +55,6 @@* - common */ #define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0) -#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)#define PTE_TYPE_LARGE (_AT(pteval_t, 1) << 0)#define PTE_TYPE_SMALL (_AT(pteval_t, 2) << 0)#define PTE_TYPE_EXT (_AT(pteval_t, 3) << 0)/* v5 */
arch/arm/include/asm/pgtable-3level-hwdef.h +0 -2
@@ -15,7 +15,6 @@* - common */ #define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0) -#define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)#define PMD_TYPE_TABLE (_AT(pmdval_t, 3) << 0)#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0)#define PMD_TABLE_BIT (_AT(pmdval_t, 1) << 1)
@@ -56,7 +55,6 @@* + Level 3 descriptor (PTE) */ #define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0) -#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0)#define PTE_TABLE_BIT (_AT(pteval_t, 1) << 1)#define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2)/* AttrIndx[0] */
Signature · 1 line
2.20.1
Russell King - ARM Linux admin
maintainerQuoted 1 line · Anshuman Khandual
Drop these unused symbols i.e
PTE_TYPE_FAULTandPMD_TYPE_FAULT.
They're documentation, although PTE_TYPE_FAULT ought to be used by __swp_entry() to show that better.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Russell King - ARM Linux admin
maintainerQuoted 5 lines · Russell King - ARM Linux admin
Quoted 1 line · Anshuman Khandual
Drop these unused symbols i.e
PTE_TYPE_FAULTandPMD_TYPE_FAULT.They're documentation, although
PTE_TYPE_FAULTought to be used by__swp_entry()to show that better.
So really, we should be doing something like this:
arch/arm/include/asm/pgtable.h +1 -1
@@ -303,7 +303,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)#define __swp_entry (type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })#define __pte_to_swp_entry (pte) ((swp_entry_t) { pte_val(pte) }) -#define __swp_entry_to_pte (swp) ((pte_t) { (swp).val }) +#define __swp_entry_to_pte (swp) __pte((swp).val | PTE_TYPE_FAULT)/* * It is an error for the kernel to have more swap files than we can
Since that is really what is going on here. It is by design that the swp_entry_t is layed out to be correct, and of course because PTE_TYPE_FAULT has the value of zero, the above merely adds to the "documentation" rather than having any functional effect.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!