Commit a9391eac authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Use '#ifdef' to test for CONFIG_xxx variables, instead of depending

on undefined preprocessor symbols evaluating to zero.

Make smpboot.c look like ANSI C with proper function declarations.
parent d0682bc8
...@@ -1153,7 +1153,7 @@ void __init smp_cpus_done(unsigned int max_cpus) ...@@ -1153,7 +1153,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
zap_low_mappings(); zap_low_mappings();
} }
void __init smp_intr_init() void __init smp_intr_init(void)
{ {
/* /*
* IRQ0 must be given a fixed assignment and initialized, * IRQ0 must be given a fixed assignment and initialized,
......
...@@ -55,7 +55,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd) ...@@ -55,7 +55,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
{ {
pmd_t *pmd_table; pmd_t *pmd_table;
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE); pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT)); set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
if (pmd_table != pmd_offset(pgd, 0)) if (pmd_table != pmd_offset(pgd, 0))
...@@ -188,7 +188,7 @@ static inline int page_is_ram(unsigned long pagenr) ...@@ -188,7 +188,7 @@ static inline int page_is_ram(unsigned long pagenr)
return 0; return 0;
} }
#if CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
pte_t *kmap_pte; pte_t *kmap_pte;
pgprot_t kmap_prot; pgprot_t kmap_prot;
...@@ -265,7 +265,7 @@ static void __init pagetable_init (void) ...@@ -265,7 +265,7 @@ static void __init pagetable_init (void)
unsigned long vaddr; unsigned long vaddr;
pgd_t *pgd_base = swapper_pg_dir; pgd_t *pgd_base = swapper_pg_dir;
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
int i; int i;
/* Init entries of the first-level page table to the zero page */ /* Init entries of the first-level page table to the zero page */
for (i = 0; i < PTRS_PER_PGD; i++) for (i = 0; i < PTRS_PER_PGD; i++)
...@@ -295,7 +295,7 @@ static void __init pagetable_init (void) ...@@ -295,7 +295,7 @@ static void __init pagetable_init (void)
permanent_kmaps_init(pgd_base); permanent_kmaps_init(pgd_base);
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
/* /*
* Add low memory identity-mappings - SMP needs it when * Add low memory identity-mappings - SMP needs it when
* starting up on an AP from real-mode. In the non-PAE * starting up on an AP from real-mode. In the non-PAE
...@@ -317,7 +317,7 @@ void zap_low_mappings (void) ...@@ -317,7 +317,7 @@ void zap_low_mappings (void)
* us, because pgd_clear() is a no-op on i386. * us, because pgd_clear() is a no-op on i386.
*/ */
for (i = 0; i < USER_PTRS_PER_PGD; i++) for (i = 0; i < USER_PTRS_PER_PGD; i++)
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page))); set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));
#else #else
set_pgd(swapper_pg_dir+i, __pgd(0)); set_pgd(swapper_pg_dir+i, __pgd(0));
...@@ -363,7 +363,7 @@ void __init paging_init(void) ...@@ -363,7 +363,7 @@ void __init paging_init(void)
load_cr3(swapper_pg_dir); load_cr3(swapper_pg_dir);
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
/* /*
* We will bail out later - printk doesn't work right now so * We will bail out later - printk doesn't work right now so
* the user would just see a hanging kernel. * the user would just see a hanging kernel.
...@@ -487,7 +487,7 @@ void __init mem_init(void) ...@@ -487,7 +487,7 @@ void __init mem_init(void)
(unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)) (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))
); );
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
if (!cpu_has_pae) if (!cpu_has_pae)
panic("cannot execute a PAE-enabled kernel on a PAE-less CPU!"); panic("cannot execute a PAE-enabled kernel on a PAE-less CPU!");
#endif #endif
...@@ -505,7 +505,7 @@ void __init mem_init(void) ...@@ -505,7 +505,7 @@ void __init mem_init(void)
#endif #endif
} }
#if CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
struct kmem_cache_s *pae_pgd_cachep; struct kmem_cache_s *pae_pgd_cachep;
void __init pgtable_cache_init(void) void __init pgtable_cache_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment