drm/nouveau/bios: allow loading alternate vbios image as firmware
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / drivers / md / bitmap.c
index 97e73e555d112c8762b7934bd9892d39f5c6e4ce..17e2b472e16dccba1a94202f616f260e8f656b6c 100644 (file)
@@ -1727,8 +1727,7 @@ int bitmap_create(struct mddev *mddev)
        bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize)
                              - BITMAP_BLOCK_SHIFT);
 
-       /* now that chunksize and chunkshift are set, we can use these macros */
-       chunks = (blocks + bitmap->chunkshift - 1) >>
+       chunks = (blocks + (1 << bitmap->chunkshift) - 1) >>
                        bitmap->chunkshift;
        pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;