diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-08-06 16:10:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 18:01:26 -0700 |
commit | 2ac521d3325a24f01c1f1e86c74537b831d282c5 (patch) | |
tree | fd89c8c59ad2a864b1b72fbb2b9c8a286c6ccd3c /lib | |
parent | 9279d3286e10736766edcaf815ae10e00856e448 (diff) | |
download | op-kernel-dev-2ac521d3325a24f01c1f1e86c74537b831d282c5.zip op-kernel-dev-2ac521d3325a24f01c1f1e86c74537b831d282c5.tar.gz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bitmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index c2f3807..faaf720 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -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); |