diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-06-20 15:53:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-20 17:39:35 -0400 |
commit | 436814e61f5c526ed123853a9bf63fb2ff4ff94b (patch) | |
tree | 57cbd11018f10bf7ad03ed9208f1e7bacf8cc85c /arch/h8300/mm | |
parent | ffb20313c01addc04212577af5f9b1399156a5bd (diff) |
h8300: use the declarations provided by <asm/sections.h>
Cleanups:
- Include <asm/sections.h>,
- Remove the (different) extern declarations,
- Remove the no longer needed address-of ('&') operators,
- Remove the superfluous casts, use proper printk formatting instead.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300/mm')
-rw-r--r-- | arch/h8300/mm/init.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c index ee4c9dbf58cc..981e25094b1a 100644 --- a/arch/h8300/mm/init.c +++ b/arch/h8300/mm/init.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/segment.h> | 36 | #include <asm/segment.h> |
37 | #include <asm/page.h> | 37 | #include <asm/page.h> |
38 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
39 | #include <asm/sections.h> | ||
39 | 40 | ||
40 | #undef DEBUG | 41 | #undef DEBUG |
41 | 42 | ||
@@ -123,7 +124,6 @@ void __init mem_init(void) | |||
123 | int codek = 0, datak = 0, initk = 0; | 124 | int codek = 0, datak = 0, initk = 0; |
124 | /* DAVIDM look at setup memory map generically with reserved area */ | 125 | /* DAVIDM look at setup memory map generically with reserved area */ |
125 | unsigned long tmp; | 126 | unsigned long tmp; |
126 | extern char _etext, _stext, _sdata, __bss_stop, __init_begin, __init_end; | ||
127 | extern unsigned long _ramend, _ramstart; | 127 | extern unsigned long _ramend, _ramstart; |
128 | unsigned long len = &_ramend - &_ramstart; | 128 | unsigned long len = &_ramend - &_ramstart; |
129 | unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ | 129 | unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ |
@@ -142,9 +142,9 @@ void __init mem_init(void) | |||
142 | /* this will put all memory onto the freelists */ | 142 | /* this will put all memory onto the freelists */ |
143 | totalram_pages = free_all_bootmem(); | 143 | totalram_pages = free_all_bootmem(); |
144 | 144 | ||
145 | codek = (&_etext - &_stext) >> 10; | 145 | codek = (_etext - _stext) >> 10; |
146 | datak = (&__bss_stop - &_sdata) >> 10; | 146 | datak = (__bss_stop - _sdata) >> 10; |
147 | initk = (&__init_begin - &__init_end) >> 10; | 147 | initk = (__init_begin - __init_end) >> 10; |
148 | 148 | ||
149 | tmp = nr_free_pages() << PAGE_SHIFT; | 149 | tmp = nr_free_pages() << PAGE_SHIFT; |
150 | printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n", | 150 | printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n", |
@@ -178,22 +178,21 @@ free_initmem(void) | |||
178 | { | 178 | { |
179 | #ifdef CONFIG_RAMKERNEL | 179 | #ifdef CONFIG_RAMKERNEL |
180 | unsigned long addr; | 180 | unsigned long addr; |
181 | extern char __init_begin, __init_end; | ||
182 | /* | 181 | /* |
183 | * the following code should be cool even if these sections | 182 | * the following code should be cool even if these sections |
184 | * are not page aligned. | 183 | * are not page aligned. |
185 | */ | 184 | */ |
186 | addr = PAGE_ALIGN((unsigned long)(&__init_begin)); | 185 | addr = PAGE_ALIGN((unsigned long)(__init_begin)); |
187 | /* next to check that the page we free is not a partial page */ | 186 | /* next to check that the page we free is not a partial page */ |
188 | for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { | 187 | for (; addr + PAGE_SIZE < (unsigned long)__init_end; addr +=PAGE_SIZE) { |
189 | ClearPageReserved(virt_to_page(addr)); | 188 | ClearPageReserved(virt_to_page(addr)); |
190 | init_page_count(virt_to_page(addr)); | 189 | init_page_count(virt_to_page(addr)); |
191 | free_page(addr); | 190 | free_page(addr); |
192 | totalram_pages++; | 191 | totalram_pages++; |
193 | } | 192 | } |
194 | printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n", | 193 | printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n", |
195 | (addr - PAGE_ALIGN((long) &__init_begin)) >> 10, | 194 | (addr - PAGE_ALIGN((long) __init_begin)) >> 10, |
196 | (int)(PAGE_ALIGN((unsigned long)(&__init_begin))), | 195 | (int)(PAGE_ALIGN((unsigned long)__init_begin)), |
197 | (int)(addr - PAGE_SIZE)); | 196 | (int)(addr - PAGE_SIZE)); |
198 | #endif | 197 | #endif |
199 | } | 198 | } |