Whamcloud - gitweb
ext2_fs.h: use the ext2fs_has_feature_64bits() instead of open coded check
authorTheodore Ts'o <tytso@mit.edu>
Fri, 12 Feb 2021 05:10:06 +0000 (00:10 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 12 Feb 2021 05:10:06 +0000 (00:10 -0500)
This makes the code a bit cleaner and fixes a false positive warning by
Coverity.  (CID #1464576)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2_fs.h

index 770a5ad..e92a045 100644 (file)
@@ -269,8 +269,7 @@ struct ext2_dx_tail {
 #define EXT2_MIN_DESC_SIZE_64BIT       64
 #define EXT2_MAX_DESC_SIZE             EXT2_MIN_BLOCK_SIZE
 #define EXT2_DESC_SIZE(s)                                                \
-       ((EXT2_SB(s)->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) ? \
-       (s)->s_desc_size : EXT2_MIN_DESC_SIZE)
+       (ext2fs_has_feature_64bit(s) ? (s)->s_desc_size : EXT2_MIN_DESC_SIZE)
 
 #define EXT2_BLOCKS_PER_GROUP(s)       (EXT2_SB(s)->s_blocks_per_group)
 #define EXT2_INODES_PER_GROUP(s)       (EXT2_SB(s)->s_inodes_per_group)