Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221027
b: refs/heads/master
c: 7dc50ec
h: refs/heads/master
i:
  221025: 52179dc
  221023: 0bf9438
v: v3
  • Loading branch information
Russell King committed Oct 28, 2010
1 parent f91a361 commit 75cf621
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8c90860cd3592fac83a349f84a20360a6498727
refs/heads/master: 7dc50ec7283391dd7a29a80e2a0fb76731a6a7c7
10 changes: 10 additions & 0 deletions trunk/arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/highmem.h>
#include <linux/gfp.h>
#include <linux/memblock.h>
#include <linux/sort.h>

#include <asm/mach-types.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -256,10 +257,19 @@ static void arm_memory_present(void)
}
#endif

static int __init meminfo_cmp(const void *_a, const void *_b)
{
const struct membank *a = _a, *b = _b;
long cmp = bank_pfn_start(a) - bank_pfn_start(b);
return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
}

void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
{
int i;

sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

memblock_init();
for (i = 0; i < mi->nr_banks; i++)
memblock_add(mi->bank[i].start, mi->bank[i].size);
Expand Down
10 changes: 0 additions & 10 deletions trunk/arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/mman.h>
#include <linux/nodemask.h>
#include <linux/memblock.h>
#include <linux/sort.h>
#include <linux/fs.h>

#include <asm/cputype.h>
Expand Down Expand Up @@ -1011,13 +1010,6 @@ static void __init map_lowmem(void)
}
}

static int __init meminfo_cmp(const void *_a, const void *_b)
{
const struct membank *a = _a, *b = _b;
long cmp = bank_pfn_start(a) - bank_pfn_start(b);
return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
}

/*
* paging_init() sets up the page tables, initialises the zone memory
* maps, and sets up the zero page, bad page and bad page tables.
Expand All @@ -1026,8 +1018,6 @@ void __init paging_init(struct machine_desc *mdesc)
{
void *zero_page;

sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

build_mem_type_table();
sanity_check_meminfo();
prepare_page_table();
Expand Down

0 comments on commit 75cf621

Please sign in to comment.