From: Jeremy Fitzhardinge Date: Tue, 20 May 2008 07:26:23 +0000 (+0100) Subject: x86: use PTE_MASK rather than ad-hoc mask X-Git-Tag: v2.6.26-rc4~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba23cef5c23cf1e9298032037d919157553d1211;p=platform%2Fkernel%2Flinux-3.10.git x86: use PTE_MASK rather than ad-hoc mask Use ~PTE_MASK to extract the non-pfn parts of the pte (ie, the pte flags), rather than constructing an ad-hoc mask. Signed-off-by: Jeremy Fitzhardinge Tested-by: Hugh Dickins Signed-off-by: Linus Torvalds --- diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index b816134..97c271b 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h @@ -305,7 +305,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) return __pgprot(preservebits | addbits); } -#define pte_pgprot(x) __pgprot(pte_val(x) & (0xfff | _PAGE_NX)) +#define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK) #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)