Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91417
b: refs/heads/master
c: eea89e1
h: refs/heads/master
i:
  91415: 79ea3e5
v: v3
  • Loading branch information
David S. Miller committed Feb 14, 2008
1 parent b5f3c2c commit 3dd3129
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: d9b2b2a277219d4812311d995054ce4f95067725
refs/heads/master: eea89e13a9c61d3928223d2f9bf2295e22e0efb6
8 changes: 7 additions & 1 deletion trunk/lib/lmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ static unsigned long lmb_align_down(unsigned long addr, unsigned long size)
return addr & ~(size - 1);
}

static unsigned long lmb_align_up(unsigned long addr, unsigned long size)
{
return (addr + (size - 1)) & ~(size - 1);
}

unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align,
unsigned long max_addr)
{
Expand Down Expand Up @@ -281,7 +286,8 @@ unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align,
if (i < 0)
return 0;

lmb_add_region(&lmb.reserved, base, size);
if (lmb_add_region(&lmb.reserved, base, lmb_align_up(size, align)) < 0)
return 0;

return base;
}
Expand Down

0 comments on commit 3dd3129

Please sign in to comment.