[PATCH] x86-64: Remove redundant max_mapnr and replace with end_pfn
authorAndi Kleen <ak@suse.de>
Mon, 12 Sep 2005 16:49:24 +0000 (18:49 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 12 Sep 2005 17:49:57 +0000 (10:49 -0700)
The FLATMEM people added it, but there doesn't seem a good reason
because end_pfn is identical.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/mm/init.c
include/asm-x86_64/page.h
include/asm-x86_64/proto.h

index 5659d979316dd5349c57b6d7d5a1f68a105e936a..b6a826d6c18226fa28afdbde0e0b7aab9e223284 100644 (file)
@@ -411,11 +411,6 @@ void __init mem_init(void)
 #ifdef CONFIG_NUMA
        totalram_pages = numa_free_all_bootmem();
 #else
-
-#ifdef CONFIG_FLATMEM
-       max_mapnr = end_pfn;
-       if (!mem_map) BUG();
-#endif
        totalram_pages = free_all_bootmem();
 #endif
        reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn);
index 135ffaa0393b4d8aa5559241d0f512fb61251742..e5ab4d231f2ce2d837dea8476e7a024f5436060a 100644 (file)
@@ -32,6 +32,8 @@
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
+extern unsigned long end_pfn;
+
 void clear_page(void *);
 void copy_page(void *, void *);
 
@@ -111,7 +113,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 #ifdef CONFIG_FLATMEM
 #define pfn_to_page(pfn)       (mem_map + (pfn))
 #define page_to_pfn(page)      ((unsigned long)((page) - mem_map))
-#define pfn_valid(pfn)         ((pfn) < max_mapnr)
+#define pfn_valid(pfn)         ((pfn) < end_pfn)
 #endif
 
 #define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
index f7574196424e1c4e266b1b0d7e9bbd4f5a48f2a3..764b5f822ce28ab5ae2bb62f35633eb1cf5d553f 100644 (file)
@@ -93,8 +93,6 @@ extern int unhandled_signal(struct task_struct *tsk, int sig);
 extern void select_idle_routine(const struct cpuinfo_x86 *c);
 extern void swiotlb_init(void);
 
-extern unsigned long max_mapnr;
-extern unsigned long end_pfn; 
 extern unsigned long table_start, table_end;
 
 extern int exception_trace;