Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96753
b: refs/heads/master
c: 4978db5
h: refs/heads/master
i:
  96751: 461ae03
v: v3
  • Loading branch information
David S. Miller committed May 12, 2008
1 parent 9a1db9c commit 6781e71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: 94d149c34cda933ff5096aca94bb23bf68602f4e
refs/heads/master: 4978db5bd964d90265f957f980ab2b0771ca2b9f
12 changes: 8 additions & 4 deletions trunk/lib/lmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ static u64 __init lmb_alloc_nid_unreserved(u64 start, u64 end,
j = lmb_overlaps_region(&lmb.reserved, base, size);
if (j < 0) {
/* this area isn't reserved, take it */
if (lmb_add_region(&lmb.reserved, base,
lmb_align_up(size, align)) < 0)
if (lmb_add_region(&lmb.reserved, base, size) < 0)
base = ~(u64)0;
return base;
}
Expand Down Expand Up @@ -333,6 +332,10 @@ u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
struct lmb_region *mem = &lmb.memory;
int i;

BUG_ON(0 == size);

size = lmb_align_up(size, align);

for (i = 0; i < mem->cnt; i++) {
u64 ret = lmb_alloc_nid_region(&mem->region[i],
nid_range,
Expand Down Expand Up @@ -370,6 +373,8 @@ u64 __init __lmb_alloc_base(u64 size, u64 align, u64 max_addr)

BUG_ON(0 == size);

size = lmb_align_up(size, align);

/* On some platforms, make sure we allocate lowmem */
/* Note that LMB_REAL_LIMIT may be LMB_ALLOC_ANYWHERE */
if (max_addr == LMB_ALLOC_ANYWHERE)
Expand All @@ -393,8 +398,7 @@ u64 __init __lmb_alloc_base(u64 size, u64 align, u64 max_addr)
j = lmb_overlaps_region(&lmb.reserved, base, size);
if (j < 0) {
/* this area isn't reserved, take it */
if (lmb_add_region(&lmb.reserved, base,
lmb_align_up(size, align)) < 0)
if (lmb_add_region(&lmb.reserved, base, size) < 0)
return 0;
return base;
}
Expand Down

0 comments on commit 6781e71

Please sign in to comment.