Commit 7590abe891c85fbc65dc906516d0bf89e070c19a

Authored by Benjamin Herrenschmidt
1 parent 4d629f9a02

memblock: Move memblock_init() to the bottom of the file

It's a real PITA to have to search for it in the middle

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 1 changed file with 27 additions and 27 deletions Side-by-side Diff

... ... @@ -107,33 +107,6 @@
107 107 memblock_remove_region(type, r2);
108 108 }
109 109  
110   -void __init memblock_init(void)
111   -{
112   - /* Hookup the initial arrays */
113   - memblock.memory.regions = memblock_memory_init_regions;
114   - memblock.memory.max = INIT_MEMBLOCK_REGIONS;
115   - memblock.reserved.regions = memblock_reserved_init_regions;
116   - memblock.reserved.max = INIT_MEMBLOCK_REGIONS;
117   -
118   - /* Write a marker in the unused last array entry */
119   - memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
120   - memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
121   -
122   - /* Create a dummy zero size MEMBLOCK which will get coalesced away later.
123   - * This simplifies the memblock_add() code below...
124   - */
125   - memblock.memory.regions[0].base = 0;
126   - memblock.memory.regions[0].size = 0;
127   - memblock.memory.cnt = 1;
128   -
129   - /* Ditto. */
130   - memblock.reserved.regions[0].base = 0;
131   - memblock.reserved.regions[0].size = 0;
132   - memblock.reserved.cnt = 1;
133   -
134   - memblock.current_limit = MEMBLOCK_ALLOC_ANYWHERE;
135   -}
136   -
137 110 void __init memblock_analyze(void)
138 111 {
139 112 int i;
... ... @@ -541,5 +514,32 @@
541 514 void __init memblock_set_current_limit(phys_addr_t limit)
542 515 {
543 516 memblock.current_limit = limit;
  517 +}
  518 +
  519 +void __init memblock_init(void)
  520 +{
  521 + /* Hookup the initial arrays */
  522 + memblock.memory.regions = memblock_memory_init_regions;
  523 + memblock.memory.max = INIT_MEMBLOCK_REGIONS;
  524 + memblock.reserved.regions = memblock_reserved_init_regions;
  525 + memblock.reserved.max = INIT_MEMBLOCK_REGIONS;
  526 +
  527 + /* Write a marker in the unused last array entry */
  528 + memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
  529 + memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
  530 +
  531 + /* Create a dummy zero size MEMBLOCK which will get coalesced away later.
  532 + * This simplifies the memblock_add() code below...
  533 + */
  534 + memblock.memory.regions[0].base = 0;
  535 + memblock.memory.regions[0].size = 0;
  536 + memblock.memory.cnt = 1;
  537 +
  538 + /* Ditto. */
  539 + memblock.reserved.regions[0].base = 0;
  540 + memblock.reserved.regions[0].size = 0;
  541 + memblock.reserved.cnt = 1;
  542 +
  543 + memblock.current_limit = MEMBLOCK_ALLOC_ANYWHERE;
544 544 }