Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132256
b: refs/heads/master
c: aa8e4fc
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 13, 2009
1 parent 3d8c327 commit 93f9f77
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 9ead64974b05501bbac0d63a47c99fa786d064ba
refs/heads/master: aa8e4fc68d8024cd3132035d13c3cefa7baeac8f
16 changes: 8 additions & 8 deletions trunk/lib/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,15 +948,15 @@ static int __reg_op(unsigned long *bitmap, int pos, int order, int reg_op)
*/
int bitmap_find_free_region(unsigned long *bitmap, int bits, int order)
{
int pos; /* scans bitmap by regions of size order */
int pos, end; /* scans bitmap by regions of size order */

for (pos = 0; pos < bits; pos += (1 << order))
if (__reg_op(bitmap, pos, order, REG_OP_ISFREE))
break;
if (pos == bits)
return -ENOMEM;
__reg_op(bitmap, pos, order, REG_OP_ALLOC);
return pos;
for (pos = 0 ; (end = pos + (1 << order)) <= bits; pos = end) {
if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
continue;
__reg_op(bitmap, pos, order, REG_OP_ALLOC);
return pos;
}
return -ENOMEM;
}
EXPORT_SYMBOL(bitmap_find_free_region);

Expand Down

0 comments on commit 93f9f77

Please sign in to comment.