md: use correct type in super_1_load
authorChristoph Hellwig <hch@lst.de>
Thu, 4 Apr 2019 16:56:12 +0000 (18:56 +0200)
committerSong Liu <songliubraving@fb.com>
Wed, 10 Apr 2019 22:26:08 +0000 (15:26 -0700)
If we want to convert from a little endian format we need to cast
to a little endian type, otherwise sparse will be unhappy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c

index a15eb7e37c6d2266e13f8177a35113912a5f7c95..7a74e2de40b5f71ac4fc091cd3105fcd21d80b7d 100644 (file)
@@ -1548,7 +1548,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
                 */
                s32 offset;
                sector_t bb_sector;
-               u64 *bbp;
+               __le64 *bbp;
                int i;
                int sectors = le16_to_cpu(sb->bblog_size);
                if (sectors > (PAGE_SIZE / 512))
@@ -1560,7 +1560,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
                if (!sync_page_io(rdev, bb_sector, sectors << 9,
                                  rdev->bb_page, REQ_OP_READ, 0, true))
                        return -EIO;
-               bbp = (u64 *)page_address(rdev->bb_page);
+               bbp = (__le64 *)page_address(rdev->bb_page);
                rdev->badblocks.shift = sb->bblog_shift;
                for (i = 0 ; i < (sectors << (9-3)) ; i++, bbp++) {
                        u64 bb = le64_to_cpu(*bbp);