aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-10-27 13:14:56 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-10-28 08:54:41 -0400
commit7dc50ec7283391dd7a29a80e2a0fb76731a6a7c7 (patch)
treecfce6e8adf5c4a50ed04f390a7acf8f4d7d8b5df /arch/arm/mm/mmu.c
parentc8c90860cd3592fac83a349f84a20360a6498727 (diff)
ARM: ensure membank array is always sorted
This was missing from the noMMU code, so there was the possibility of things not working as expected if out of order memory information was passed. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 8e21b4e721e4..5222d3850960 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -14,7 +14,6 @@
14#include <linux/mman.h> 14#include <linux/mman.h>
15#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16#include <linux/memblock.h> 16#include <linux/memblock.h>
17#include <linux/sort.h>
18#include <linux/fs.h> 17#include <linux/fs.h>
19 18
20#include <asm/cputype.h> 19#include <asm/cputype.h>
@@ -1011,13 +1010,6 @@ static void __init map_lowmem(void)
1011 } 1010 }
1012} 1011}
1013 1012
1014static int __init meminfo_cmp(const void *_a, const void *_b)
1015{
1016 const struct membank *a = _a, *b = _b;
1017 long cmp = bank_pfn_start(a) - bank_pfn_start(b);
1018 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
1019}
1020
1021/* 1013/*
1022 * paging_init() sets up the page tables, initialises the zone memory 1014 * paging_init() sets up the page tables, initialises the zone memory
1023 * maps, and sets up the zero page, bad page and bad page tables. 1015 * maps, and sets up the zero page, bad page and bad page tables.
@@ -1026,8 +1018,6 @@ void __init paging_init(struct machine_desc *mdesc)
1026{ 1018{
1027 void *zero_page; 1019 void *zero_page;
1028 1020
1029 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
1030
1031 build_mem_type_table(); 1021 build_mem_type_table();
1032 sanity_check_meminfo(); 1022 sanity_check_meminfo();
1033 prepare_page_table(); 1023 prepare_page_table();