Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68knommu: clean up mm/init_no.c

The memory initialization code for m68knommu has grown a bit crufty,
clean it up.

. remove unused declaration for die_if_kernel()
. remove un-needed declaration of free_initmem()
. removed unused definitions of empty_bad_page and empty_bad_page_table
. removed unused DEBUG code
. make free_initmem() proper prototype

Signed-off-by: Greg Ungerer <gerg@uclinux.org>

+4 -47
+4 -47
arch/m68k/mm/init_no.c
··· 38 38 #include <asm/system.h> 39 39 #include <asm/machdep.h> 40 40 41 - #undef DEBUG 42 - 43 - extern void die_if_kernel(char *,struct pt_regs *,long); 44 - extern void free_initmem(void); 45 - 46 41 /* 47 - * BAD_PAGE is the page that is used for page faults when linux 48 - * is out-of-memory. Older versions of linux just did a 49 - * do_exit(), but using this instead means there is less risk 50 - * for a process dying in kernel mode, possibly leaving a inode 51 - * unused etc.. 52 - * 53 - * BAD_PAGETABLE is the accompanying page-table: it is initialized 54 - * to point to BAD_PAGE entries. 55 - * 56 42 * ZERO_PAGE is a special page that is used for zero-initialized 57 43 * data and COW. 58 44 */ 59 - static unsigned long empty_bad_page_table; 60 - 61 - static unsigned long empty_bad_page; 62 - 63 45 unsigned long empty_zero_page; 64 46 65 47 extern unsigned long memory_start; ··· 59 77 * Make sure start_mem is page aligned, otherwise bootmem and 60 78 * page_alloc get different views of the world. 61 79 */ 62 - #ifdef DEBUG 63 - unsigned long start_mem = PAGE_ALIGN(memory_start); 64 - #endif 65 80 unsigned long end_mem = memory_end & PAGE_MASK; 81 + unsigned long zones_size[MAX_NR_ZONES] = {0, }; 66 82 67 - #ifdef DEBUG 68 - printk (KERN_DEBUG "start_mem is %#lx\nvirtual_end is %#lx\n", 69 - start_mem, end_mem); 70 - #endif 71 - 72 - /* 73 - * Initialize the bad page table and bad page to point 74 - * to a couple of allocated pages. 75 - */ 76 - empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 77 - empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 78 83 empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 79 84 memset((void *)empty_zero_page, 0, PAGE_SIZE); 80 85 ··· 70 101 */ 71 102 set_fs (USER_DS); 72 103 73 - #ifdef DEBUG 74 - printk (KERN_DEBUG "before free_area_init\n"); 75 - 76 - printk (KERN_DEBUG "free_area_init -> start_mem is %#lx\nvirtual_end is %#lx\n", 77 - start_mem, end_mem); 78 - #endif 79 - 80 - { 81 - unsigned long zones_size[MAX_NR_ZONES] = {0, }; 82 - 83 - zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; 84 - free_area_init(zones_size); 85 - } 104 + zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; 105 + free_area_init(zones_size); 86 106 } 87 107 88 108 void __init mem_init(void) ··· 124 166 } 125 167 #endif 126 168 127 - void 128 - free_initmem() 169 + void free_initmem(void) 129 170 { 130 171 #ifdef CONFIG_RAMKERNEL 131 172 unsigned long addr;