Skip to contentSkip to conversation

x86: mm/init.c declare direct_gbpages and free_initrd_mem before they get used

PATCH New Jaswinder Singh Rajput 1 participant 1 message Apr 9, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: mm/init.c declare direct_gbpages and free_initrd_mem before they get used

Impact: fix sparse warnings:
arch/x86/mm/init.c:19:5: warning: symbol 'direct_gbpages' was not declared. Should it be static? arch/x86/mm/init.c:390:6: warning: symbol 'free_initrd_mem' was not declared. Should it be static?

direct_gbpages is required for both 32 and 64 bit, so move direct_gbpages declaration from pgtable_64.h to pgtable.h

Also fixed extra ifndef __ASSEMBLY__ in pgtable_64.h

---
 arch/x86/include/asm/pgtable.h    |    2 ++
 arch/x86/include/asm/pgtable_64.h |    6 ------
 arch/x86/mm/init.c                |    1 +
 3 files changed, 3 insertions(+), 6 deletions(-)
arch/x86/include/asm/pgtable.h +2 -0
index 205f6a9..577485b 100644
@@ -510,6 +510,8 @@ static inline int pte_hidden(pte_t pte)
 
 #ifndef __ASSEMBLY__
 
+extern int direct_gbpages;
+
 /* local pte updates need not use xchg for locking */
 static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
 {
arch/x86/include/asm/pgtable_64.h +0 -6
index 6b87bc6..abde308 100644
@@ -25,10 +25,6 @@ extern pgd_t init_level4_pgt[];
 
 extern void paging_init(void);
 
-#endif /* !__ASSEMBLY__ */
-
-#ifndef __ASSEMBLY__
-
 #define pte_ERROR(e)					\
 	printk("%s:%d: bad pte %p(%016lx).\n",		\
 	       __FILE__, __LINE__, &(e), pte_val(e))
@@ -135,8 +131,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
 
 #define update_mmu_cache(vma, address, pte) do { } while (0)
 
-extern int direct_gbpages;
-
 /* Encode and de-code a swap entry */
 #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
arch/x86/mm/init.c +1 -0
index 51ae5ea..688c008 100644
@@ -1,3 +1,4 @@
+#include <linux/initrd.h>	/* free_initrd_mem */
 #include <linux/ioport.h>
 #include <linux/swap.h>
 
Signature · 1 line
1.6.0.6