Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212701
b: refs/heads/master
c: 4d629f9
h: refs/heads/master
i:
  212699: fcf1609
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Aug 5, 2010
1 parent 190deb0 commit 8de01b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 3a9c2c81eb2024c136cc534df534f93682d516d0
refs/heads/master: 4d629f9a02e32f8fe035a11018472ea8ff9647eb
12 changes: 7 additions & 5 deletions trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ static int memblock_debug;
static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS + 1];
static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS + 1];

#define MEMBLOCK_ERROR (~(phys_addr_t)0)

static int __init early_memblock(char *p)
{
if (p && strstr(p, "debug"))
Expand Down Expand Up @@ -326,7 +328,7 @@ static phys_addr_t __init memblock_find_region(phys_addr_t start, phys_addr_t en
base = memblock_align_down(res_base - size, align);
}

return ~(phys_addr_t)0;
return MEMBLOCK_ERROR;
}

phys_addr_t __weak __init memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid)
Expand All @@ -353,14 +355,14 @@ static phys_addr_t __init memblock_alloc_nid_region(struct memblock_region *mp,
this_end = memblock_nid_range(start, end, &this_nid);
if (this_nid == nid) {
phys_addr_t ret = memblock_find_region(start, this_end, size, align);
if (ret != ~(phys_addr_t)0 &&
if (ret != MEMBLOCK_ERROR &&
memblock_add_region(&memblock.reserved, ret, size) >= 0)
return ret;
}
start = this_end;
}

return ~(phys_addr_t)0;
return MEMBLOCK_ERROR;
}

phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)
Expand All @@ -379,7 +381,7 @@ phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int n
for (i = 0; i < mem->cnt; i++) {
phys_addr_t ret = memblock_alloc_nid_region(&mem->regions[i],
size, align, nid);
if (ret != ~(phys_addr_t)0)
if (ret != MEMBLOCK_ERROR)
return ret;
}

Expand Down Expand Up @@ -430,7 +432,7 @@ phys_addr_t __init __memblock_alloc_base(phys_addr_t size, phys_addr_t align, ph
continue;
base = min(memblockbase + memblocksize, max_addr);
res_base = memblock_find_region(memblockbase, base, size, align);
if (res_base != ~(phys_addr_t)0 &&
if (res_base != MEMBLOCK_ERROR &&
memblock_add_region(&memblock.reserved, res_base, size) >= 0)
return res_base;
}
Expand Down

0 comments on commit 8de01b2

Please sign in to comment.