mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
lib: bitmap: micro-optimize bitmap_allocate_region
__reg_op(..., REG_OP_ALLOC) always returns 0, so we might as well use that and save an instruction. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9279d3286e
commit
2ac521d332
@ -1154,8 +1154,7 @@ int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
|
||||
{
|
||||
if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
|
||||
return -EBUSY;
|
||||
__reg_op(bitmap, pos, order, REG_OP_ALLOC);
|
||||
return 0;
|
||||
return __reg_op(bitmap, pos, order, REG_OP_ALLOC);
|
||||
}
|
||||
EXPORT_SYMBOL(bitmap_allocate_region);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user