diff options
| author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-08-06 16:10:18 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:59:32 +0200 |
| commit | f28752989c4d7a076a2414cd6eaab8083fd1ea10 (patch) | |
| tree | f279fbe1f6c73f736dac698ff8b0a645aee6e8ff | |
| parent | 3ea5867dce212e99915b225b8bd52af8bc7780c4 (diff) | |
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>
| -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 8e50356c3..5516a9004 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -1104,8 +1104,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); |
