Commit 436814e61f5c526ed123853a9bf63fb2ff4ff94b

Authored by Geert Uytterhoeven
Committed by Linus Torvalds
1 parent ffb20313c0

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>

Showing 2 changed files with 18 additions and 22 deletions Side-by-side Diff

arch/h8300/kernel/setup.c
... ... @@ -35,6 +35,7 @@
35 35 #include <asm/setup.h>
36 36 #include <asm/irq.h>
37 37 #include <asm/pgtable.h>
  38 +#include <asm/sections.h>
38 39  
39 40 #if defined(__H8300H__)
40 41 #define CPU "H8/300H"
... ... @@ -54,7 +55,6 @@
54 55  
55 56 char __initdata command_line[COMMAND_LINE_SIZE];
56 57  
57   -extern int _stext, _etext, _sdata, _edata, __bss_start, __bss_stop, _end;
58 58 extern int _ramstart, _ramend;
59 59 extern char _target_name[];
60 60 extern void h8300_gpio_init(void);
... ... @@ -119,9 +119,9 @@
119 119 memory_end = CONFIG_BLKDEV_RESERVE_ADDRESS;
120 120 #endif
121 121  
122   - init_mm.start_code = (unsigned long) &_stext;
123   - init_mm.end_code = (unsigned long) &_etext;
124   - init_mm.end_data = (unsigned long) &_edata;
  122 + init_mm.start_code = (unsigned long) _stext;
  123 + init_mm.end_code = (unsigned long) _etext;
  124 + init_mm.end_data = (unsigned long) _edata;
125 125 init_mm.brk = (unsigned long) 0;
126 126  
127 127 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) && defined(CONFIG_GDB_MAGICPRINT)
... ... @@ -134,15 +134,12 @@
134 134 printk(KERN_INFO "H8/300 series support by Yoshinori Sato <ysato@users.sourceforge.jp>\n");
135 135  
136 136 #ifdef DEBUG
137   - printk(KERN_DEBUG "KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
138   - "BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext,
139   - (int) &_sdata, (int) &_edata,
140   - (int) &__bss_start, (int) &__bss_stop);
141   - printk(KERN_DEBUG "KERNEL -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x "
142   - "STACK=0x%06x-0x%06x\n",
143   - (int) &__bss_stop, (int) memory_start,
144   - (int) memory_start, (int) memory_end,
145   - (int) memory_end, (int) &_ramend);
  137 + printk(KERN_DEBUG "KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p "
  138 + "BSS=0x%p-0x%p\n", _stext, _etext, _sdata, _edata, __bss_start,
  139 + __bss_stop);
  140 + printk(KERN_DEBUG "KERNEL -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx "
  141 + "STACK=0x%06lx-0x%p\n", __bss_stop, memory_start, memory_start,
  142 + memory_end, memory_end, &_ramend);
146 143 #endif
147 144  
148 145 #ifdef CONFIG_DEFAULT_CMDLINE
arch/h8300/mm/init.c
... ... @@ -36,6 +36,7 @@
36 36 #include <asm/segment.h>
37 37 #include <asm/page.h>
38 38 #include <asm/pgtable.h>
  39 +#include <asm/sections.h>
39 40  
40 41 #undef DEBUG
41 42  
... ... @@ -123,7 +124,6 @@
123 124 int codek = 0, datak = 0, initk = 0;
124 125 /* DAVIDM look at setup memory map generically with reserved area */
125 126 unsigned long tmp;
126   - extern char _etext, _stext, _sdata, __bss_stop, __init_begin, __init_end;
127 127 extern unsigned long _ramend, _ramstart;
128 128 unsigned long len = &_ramend - &_ramstart;
129 129 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
... ... @@ -142,9 +142,9 @@
142 142 /* this will put all memory onto the freelists */
143 143 totalram_pages = free_all_bootmem();
144 144  
145   - codek = (&_etext - &_stext) >> 10;
146   - datak = (&__bss_stop - &_sdata) >> 10;
147   - initk = (&__init_begin - &__init_end) >> 10;
  145 + codek = (_etext - _stext) >> 10;
  146 + datak = (__bss_stop - _sdata) >> 10;
  147 + initk = (__init_begin - __init_end) >> 10;
148 148  
149 149 tmp = nr_free_pages() << PAGE_SHIFT;
150 150 printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
151 151  
152 152  
153 153  
... ... @@ -178,22 +178,21 @@
178 178 {
179 179 #ifdef CONFIG_RAMKERNEL
180 180 unsigned long addr;
181   - extern char __init_begin, __init_end;
182 181 /*
183 182 * the following code should be cool even if these sections
184 183 * are not page aligned.
185 184 */
186   - addr = PAGE_ALIGN((unsigned long)(&__init_begin));
  185 + addr = PAGE_ALIGN((unsigned long)(__init_begin));
187 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 188 ClearPageReserved(virt_to_page(addr));
190 189 init_page_count(virt_to_page(addr));
191 190 free_page(addr);
192 191 totalram_pages++;
193 192 }
194 193 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
195   - (addr - PAGE_ALIGN((long) &__init_begin)) >> 10,
196   - (int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
  194 + (addr - PAGE_ALIGN((long) __init_begin)) >> 10,
  195 + (int)(PAGE_ALIGN((unsigned long)__init_begin)),
197 196 (int)(addr - PAGE_SIZE));
198 197 #endif
199 198 }