[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090718141157.GH32618@elte.hu>
Date: Sat, 18 Jul 2009 16:11:57 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Zhaolei <zhaolei@...fujitsu.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Vegard Nossum <vegard.nossum@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Remove initialization of page_table in
one_page_table_init()
* Zhaolei <zhaolei@...fujitsu.com> wrote:
> Only judge if (!page_table) when CONFIG_DEBUG_PAGEALLOC or CONFIG_KMEMCHECK
> are defined, then we don't need to set init value for page_table.
>
> Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
> ---
> arch/x86/mm/init_32.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index 3cd7711..55da09b 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -108,13 +108,13 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
> static pte_t * __init one_page_table_init(pmd_t *pmd)
> {
> if (!(pmd_val(*pmd) & _PAGE_PRESENT)) {
> - pte_t *page_table = NULL;
> + pte_t *page_table;
>
> if (after_bootmem) {
> #if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
> page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE);
> -#endif
> if (!page_table)
> +#endif
> page_table =
> (pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
I think the original code was cleaner - putting an #ifdef straight
into the middle of a control block is quite fragile.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists