qed: move chain initialization inlines next to allocation functions
[linux-2.6-microblaze.git] / lib / bitmap.c
index 21a7640..0364452 100644 (file)
@@ -741,8 +741,9 @@ int bitmap_parse(const char *start, unsigned int buflen,
        int chunks = BITS_TO_U32(nmaskbits);
        u32 *bitmap = (u32 *)maskp;
        int unset_bit;
+       int chunk;
 
-       while (1) {
+       for (chunk = 0; ; chunk++) {
                end = bitmap_find_region_reverse(start, end);
                if (start > end)
                        break;
@@ -750,7 +751,11 @@ int bitmap_parse(const char *start, unsigned int buflen,
                if (!chunks--)
                        return -EOVERFLOW;
 
-               end = bitmap_get_x32_reverse(start, end, bitmap++);
+#if defined(CONFIG_64BIT) && defined(__BIG_ENDIAN)
+               end = bitmap_get_x32_reverse(start, end, &bitmap[chunk ^ 1]);
+#else
+               end = bitmap_get_x32_reverse(start, end, &bitmap[chunk]);
+#endif
                if (IS_ERR(end))
                        return PTR_ERR(end);
        }