Prepare for verifying structure sizes with static_assert().

Signed-off-by: Bart Van Assche <bvanass...@acm.org>
---
 fsck/f2fs.h       | 4 ++--
 include/f2fs_fs.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 7fb328ff8861..eacfd42478b8 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -381,7 +381,7 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, 
int flag)
                                        CP_MIN_CHKSUM_OFFSET)
                        chksum_size = sizeof(__le32);
 
-               return &ckpt->sit_nat_version_bitmap + offset + chksum_size;
+               return &ckpt->sit_nat_version_bitmap[offset + chksum_size];
        }
 
        if (le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload) > 0) {
@@ -392,7 +392,7 @@ static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, 
int flag)
        } else {
                offset = (flag == NAT_BITMAP) ?
                        le32_to_cpu(ckpt->sit_ver_bitmap_bytesize) : 0;
-               return &ckpt->sit_nat_version_bitmap + offset;
+               return &ckpt->sit_nat_version_bitmap[offset];
        }
 }
 
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 1e38d93ff40d..e6fc8a0e08f6 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -832,7 +832,7 @@ struct f2fs_checkpoint {
        unsigned char alloc_type[MAX_ACTIVE_LOGS];
 
        /* SIT and NAT version bitmap */
-       unsigned char sit_nat_version_bitmap[1];
+       unsigned char sit_nat_version_bitmap[];
 } __attribute__((packed));
 
 #define CP_BITMAP_OFFSET       \


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to