Re: [PATCH 36 of 36] x86: make the X_bad functions consistent

From: Hugh Dickins
Date: Thu Feb 05 2009 - 15:26:53 EST


On Thu, 5 Feb 2009, Jeremy Fitzhardinge wrote:

> Impact: cleanup
>
> Use the same logic to implement all 3 _bad() functions.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

A backward step in my opinion.

Hugh

> ---
> 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/