lkml.org 
[lkml]   [2009]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 36 of 36] x86: make the X_bad functions consistent
Date
From
Impact: cleanup

Use the same logic to implement all 3 _bad() functions.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/include/asm/pgtable.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -554,7 +554,7 @@

static inline int pmd_bad(pmd_t pmd)
{
- return (pmd_flags(pmd) & ~_PAGE_USER) != _KERNPG_TABLE;
+ return (pmd_flags(pmd) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
}

static inline unsigned long pages_to_mb(unsigned long npg)
@@ -638,7 +638,7 @@

static inline int pgd_bad(pgd_t pgd)
{
- return (pgd_flags(pgd) & ~_PAGE_USER) != _KERNPG_TABLE;
+ return (pgd_flags(pgd) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
}

static inline int pgd_none(pgd_t pgd)



\
 
 \ /
  Last update: 2009-02-05 20:43    [W:0.098 / U:1.452 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site