[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1404427384-11422-16-git-send-email-linux@rasmusvillemoes.dk>
Date: Fri, 4 Jul 2014 00:43:01 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: linux-kernel@...r.kernel.org
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH 15/18] 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@...musvillemoes.dk>
---
lib/bitmap.c | 3 +--
1 file changed, 1 insertion(+), 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);
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists