From: Rasmus Villemoes Date: Wed, 6 Aug 2014 23:10:18 +0000 (-0700) Subject: lib: bitmap: micro-optimize bitmap_allocate_region X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ac521d3325a24f01c1f1e86c74537b831d282c5;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/bitmap.c b/lib/bitmap.c index c2f3807b3601..faaf7206d4cf 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);