]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lib-bitmapc-speed-up-bitmap_find_free_region-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 9 May 2013 23:57:25 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 21 May 2013 04:17:45 +0000 (14:17 +1000)
reduce scope of locals, remove barely comprehensible comment

Cc: Chanho Min <chanho.min@lge.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Joe Perches <joe@perches.com>
Cc: Nadia Yvette Chambers <nyc@holomorphy.com>
Cc: anish singh <anish198519851985@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/bitmap.c

index 95e8efc18f6834161cfc95c2554395f28e6785fd..ea190b7047c3fc5c46cd158bcb78fc1597518aee 100644 (file)
@@ -1114,13 +1114,15 @@ done:
  */
 int bitmap_find_free_region(unsigned long *bitmap, int bits, int order)
 {
-       int pos, end, nbit, i;  /* scans bitmap by regions of size order */
        int nlongs = BITS_TO_LONGS(bits);
+       int i;
 
        for (i = 0; i < nlongs; i++)
                if (bitmap[i] != ~0UL) {
-                       pos = i * BITS_PER_LONG;
-                       nbit = min(bits, pos + BITS_PER_LONG);
+                       int pos = i * BITS_PER_LONG;
+                       int nbit = min(bits, pos + BITS_PER_LONG);
+                       int end;
+
                        for (; (end = pos + (1 << order)) <= nbit; pos = end) {
                                if (!__reg_op(bitmap, pos, order,
                                        REG_OP_ISFREE))