From: Tejun Heo This patch removes page_pte_prot and page_pte macros from all architectures. Some architectures define both, some only page_pte (broken) and others none. These macros are not used anywhere. page_pte_prot(page, prot) is identical to mk_pte(page, prot) and page_pte(page) is identical to page_pte_prot(page, __pgprot(0)). * The following architectures define both page_pte_prot and page_pte arm, arm26, ia64, sh64, sparc, sparc64 * The following architectures define only page_pte (broken) frv, i386, m32r, mips, sh, x86-64 * All other architectures define neither Signed-off-by: Tejun Heo Signed-off-by: Andrew Morton --- include/asm-arm/pgtable.h | 3 --- include/asm-arm26/pgtable.h | 2 -- include/asm-frv/pgtable.h | 2 -- include/asm-i386/pgtable.h | 2 -- include/asm-ia64/pgtable.h | 3 --- include/asm-m32r/pgtable.h | 2 -- include/asm-mips/pgtable-64.h | 1 - include/asm-mips/pgtable.h | 1 - include/asm-sh/pgtable.h | 2 -- include/asm-sh64/pgtable.h | 3 --- include/asm-sparc/pgtable.h | 2 -- include/asm-sparc64/pgtable.h | 3 --- include/asm-x86_64/pgtable.h | 2 -- 13 files changed, 28 deletions(-) diff -puN include/asm-arm26/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-arm26/pgtable.h --- devel/include/asm-arm26/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-arm26/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -98,8 +98,6 @@ extern struct page *empty_zero_page; #define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) #define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) -#define page_pte_prot(page,prot) mk_pte(page, prot) -#define page_pte(page) mk_pte(page, __pgprot(0)) /* * Terminology: PGD = Page Directory, PMD = Page Middle Directory, diff -puN include/asm-arm/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-arm/pgtable.h --- devel/include/asm-arm/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-arm/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -397,9 +397,6 @@ static inline pte_t *pmd_page_kernel(pmd #define pgd_clear(pgdp) do { } while (0) #define set_pgd(pgd,pgdp) do { } while (0) -#define page_pte_prot(page,prot) mk_pte(page, prot) -#define page_pte(page) mk_pte(page, __pgprot(0)) - /* to find an entry in a page-table-directory */ #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) diff -puN include/asm-frv/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-frv/pgtable.h --- devel/include/asm-frv/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-frv/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -436,8 +436,6 @@ static inline pte_t pte_modify(pte_t pte return pte; } -#define page_pte(page) page_pte_prot((page), __pgprot(0)) - /* to find an entry in a page-table-directory. */ #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) #define pgd_index_k(addr) pgd_index(addr) diff -puN include/asm-i386/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-i386/pgtable.h --- devel/include/asm-i386/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-i386/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -323,8 +323,6 @@ static inline pte_t pte_modify(pte_t pte return pte; } -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - #define pmd_large(pmd) \ ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT)) diff -puN include/asm-ia64/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-ia64/pgtable.h --- devel/include/asm-ia64/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-ia64/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -236,9 +236,6 @@ ia64_phys_addr_valid (unsigned long addr #define pte_modify(_pte, newprot) \ (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK))) -#define page_pte_prot(page,prot) mk_pte(page, prot) -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - #define pte_none(pte) (!pte_val(pte)) #define pte_present(pte) (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE)) #define pte_clear(mm,addr,pte) (pte_val(*(pte)) = 0UL) diff -puN include/asm-m32r/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-m32r/pgtable.h --- devel/include/asm-m32r/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-m32r/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -324,8 +324,6 @@ static inline pte_t pte_modify(pte_t pte return pte; } -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. diff -puN include/asm-mips/pgtable-64.h~vm-remove-unused-broken-page_pte-macros include/asm-mips/pgtable-64.h --- devel/include/asm-mips/pgtable-64.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-mips/pgtable-64.h 2005-10-23 16:36:06.000000000 -0700 @@ -169,7 +169,6 @@ static inline void pud_clear(pud_t *pudp #define __pgd_offset(address) pgd_index(address) #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) #define __pmd_offset(address) pmd_index(address) -#define page_pte(page) page_pte_prot(page, __pgprot(0)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, 0) diff -puN include/asm-mips/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-mips/pgtable.h --- devel/include/asm-mips/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-mips/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -75,7 +75,6 @@ extern void paging_init(void); * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ -#define page_pte(page) page_pte_prot(page, __pgprot(0)) #define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET) #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) #define pmd_page_kernel(pmd) pmd_val(pmd) diff -puN include/asm-sh64/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-sh64/pgtable.h --- devel/include/asm-sh64/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-sh64/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -457,9 +457,6 @@ extern inline pte_t pte_mkhuge(pte_t pte extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } -#define page_pte_prot(page, prot) mk_pte(page, prot) -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - typedef pte_t *pte_addr_t; #define pgtable_cache_init() do { } while (0) diff -puN include/asm-sh/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-sh/pgtable.h --- devel/include/asm-sh/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-sh/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -224,8 +224,6 @@ static inline pgprot_t pgprot_noncached( static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - #define pmd_page_kernel(pmd) \ ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) diff -puN include/asm-sparc64/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-sparc64/pgtable.h --- devel/include/asm-sparc64/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-sparc64/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -231,9 +231,6 @@ extern struct page *mem_map_zero; #define pte_pfn(x) ((pte_val(x) & _PAGE_PADDR)>>PAGE_SHIFT) #define pte_page(x) pfn_to_page(pte_pfn(x)) -#define page_pte_prot(page, prot) mk_pte(page, prot) -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) { pte_t __pte; diff -puN include/asm-sparc/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-sparc/pgtable.h --- devel/include/asm-sparc/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-sparc/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -255,8 +255,6 @@ BTFIXUPDEF_CALL_CONST(pte_t, pte_mkyoung #define pte_mkdirty(pte) BTFIXUP_CALL(pte_mkdirty)(pte) #define pte_mkyoung(pte) BTFIXUP_CALL(pte_mkyoung)(pte) -#define page_pte_prot(page, prot) mk_pte(page, prot) -#define page_pte(page) mk_pte(page, __pgprot(0)) #define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) BTFIXUPDEF_CALL(unsigned long, pte_pfn, pte_t) diff -puN include/asm-x86_64/pgtable.h~vm-remove-unused-broken-page_pte-macros include/asm-x86_64/pgtable.h --- devel/include/asm-x86_64/pgtable.h~vm-remove-unused-broken-page_pte-macros 2005-10-23 16:35:49.000000000 -0700 +++ devel-akpm/include/asm-x86_64/pgtable.h 2005-10-23 16:35:49.000000000 -0700 @@ -319,8 +319,6 @@ static inline int pmd_large(pmd_t pte) { * and a page entry and page directory to the page they refer to. */ -#define page_pte(page) page_pte_prot(page, __pgprot(0)) - /* * Level 4 access. */ _