diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-30 14:29:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-30 16:34:15 -0400 |
commit | eca73214c9c50e290b8dc823b41730b01788872d (patch) | |
tree | 22df16b626afa6fb9755ce289c6efa254f1ae3d4 /arch/arm/mm/nommu.c | |
parent | da46c79a5418dd6ba006665c1535af0713bb77b9 (diff) |
[ARM] mm: move validation of membanks to one place
The newly introduced sanity_check_meminfo() function should be
used to collect all validation of the meminfo array, which we
have in bootmem_init(). Move it there.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/nommu.c')
-rw-r--r-- | arch/arm/mm/nommu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index 81a3000973b4..07b62b238979 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c | |||
@@ -41,12 +41,26 @@ void __init reserve_node_zero(pg_data_t *pgdat) | |||
41 | BOOTMEM_DEFAULT); | 41 | BOOTMEM_DEFAULT); |
42 | } | 42 | } |
43 | 43 | ||
44 | static void __init sanity_check_meminfo(struct meminfo *mi) | ||
45 | { | ||
46 | int i, j; | ||
47 | |||
48 | for (i = 0, j = 0; i < mi->nr_banks; i++) { | ||
49 | struct membank *mb = &mi->bank[i]; | ||
50 | |||
51 | if (mb->size != 0 && mb->node < MAX_NUMNODES) | ||
52 | mi->bank[j++] = mi->bank[i]; | ||
53 | } | ||
54 | mi->nr_banks = j; | ||
55 | } | ||
56 | |||
44 | /* | 57 | /* |
45 | * paging_init() sets up the page tables, initialises the zone memory | 58 | * paging_init() sets up the page tables, initialises the zone memory |
46 | * maps, and sets up the zero page, bad page and bad page tables. | 59 | * maps, and sets up the zero page, bad page and bad page tables. |
47 | */ | 60 | */ |
48 | void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc) | 61 | void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc) |
49 | { | 62 | { |
63 | sanity_check_meminfo(mi); | ||
50 | bootmem_init(mi); | 64 | bootmem_init(mi); |
51 | } | 65 | } |
52 | 66 | ||