Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14718
b: refs/heads/master
c: 4659633
h: refs/heads/master
v: v3
  • Loading branch information
Chris Humbert authored and Linus Torvalds committed Nov 28, 2005
1 parent 3bfcf9f commit c3fe57d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: 7729ac5efe156129d172784fedeaddb2167a1914
refs/heads/master: 46596338a10a54550ff03a6f60c28145a080296b
14 changes: 6 additions & 8 deletions trunk/lib/genalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,10 @@ unsigned long gen_pool_alloc(struct gen_pool *poolp, int size)
if (size > max_chunk_size)
return 0;

i = 0;

size = max(size, 1 << ALLOC_MIN_SHIFT);
s = roundup_pow_of_two(size);

j = i;
i = fls(size - 1);
s = 1 << i;
j = i -= ALLOC_MIN_SHIFT;

spin_lock_irqsave(&poolp->lock, flags);
while (!h[j].next) {
Expand Down Expand Up @@ -153,10 +151,10 @@ void gen_pool_free(struct gen_pool *poolp, unsigned long ptr, int size)
if (size > max_chunk_size)
return;

i = 0;

size = max(size, 1 << ALLOC_MIN_SHIFT);
s = roundup_pow_of_two(size);
i = fls(size - 1);
s = 1 << i;
i -= ALLOC_MIN_SHIFT;

a = ptr;

Expand Down

0 comments on commit c3fe57d

Please sign in to comment.