Skip to content

Commit d2c40c1

Browse files
committed
btrfs-progs: print-tree: use ARRAY_SIZE() to replace open-coded ones
For compat_ro_flags_num and incompat_flags_num, just use ARRAY_SIZE(). Signed-off-by: Qu Wenruo <wqu@suse.com>
1 parent 58dfcf8 commit d2c40c1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel-shared/print-tree.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,8 +1889,7 @@ static struct readable_flag_entry compat_ro_flags_array[] = {
18891889
DEF_COMPAT_RO_FLAG_ENTRY(FREE_SPACE_TREE_VALID),
18901890
DEF_COMPAT_RO_FLAG_ENTRY(BLOCK_GROUP_TREE),
18911891
};
1892-
static const int compat_ro_flags_num = sizeof(compat_ro_flags_array) /
1893-
sizeof(struct readable_flag_entry);
1892+
static const int compat_ro_flags_num = ARRAY_SIZE(compat_ro_flags_array);
18941893

18951894
#define DEF_INCOMPAT_FLAG_ENTRY(bit_name) \
18961895
{BTRFS_FEATURE_INCOMPAT_##bit_name, #bit_name}
@@ -1913,8 +1912,7 @@ static struct readable_flag_entry incompat_flags_array[] = {
19131912
DEF_INCOMPAT_FLAG_ENTRY(RAID_STRIPE_TREE),
19141913
DEF_INCOMPAT_FLAG_ENTRY(SIMPLE_QUOTA),
19151914
};
1916-
static const int incompat_flags_num = sizeof(incompat_flags_array) /
1917-
sizeof(struct readable_flag_entry);
1915+
static const int incompat_flags_num = ARRAY_SIZE(incompat_flags_array);
19181916

19191917
#define DEF_HEADER_FLAG_ENTRY(bit_name) \
19201918
{BTRFS_HEADER_FLAG_##bit_name, #bit_name}

0 commit comments

Comments
 (0)