aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-08-06 19:10:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:26 -0400
commit2ac521d3325a24f01c1f1e86c74537b831d282c5 (patch)
treefd89c8c59ad2a864b1b72fbb2b9c8a286c6ccd3c
parent9279d3286e10736766edcaf815ae10e00856e448 (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.c3
1 files changed, 1 insertions, 2 deletions
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)
1154{ 1154{
1155 if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE)) 1155 if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
1156 return -EBUSY; 1156 return -EBUSY;
1157 __reg_op(bitmap, pos, order, REG_OP_ALLOC); 1157 return __reg_op(bitmap, pos, order, REG_OP_ALLOC);
1158 return 0;
1159} 1158}
1160EXPORT_SYMBOL(bitmap_allocate_region); 1159EXPORT_SYMBOL(bitmap_allocate_region);
1161 1160