aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/ext2fs/ext2_lookup.c')
-rw-r--r--sys/fs/ext2fs/ext2_lookup.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
index 9aadb6a47d3b..edd57049db4a 100644
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -88,9 +88,8 @@ static u_char ext2_ft_to_dt[] = {
DT_SOCK, /* EXT2_FT_SOCK */
DT_LNK, /* EXT2_FT_SYMLINK */
};
-#define FTTODT(ft) \
- ((ft) > sizeof(ext2_ft_to_dt) / sizeof(ext2_ft_to_dt[0]) ? \
- DT_UNKNOWN : ext2_ft_to_dt[(ft)])
+#define FTTODT(ft) \
+ ((ft) > nitems(ext2_ft_to_dt) ? DT_UNKNOWN : ext2_ft_to_dt[(ft)])
static u_char dt_to_ext2_ft[] = {
EXT2_FT_UNKNOWN, /* DT_UNKNOWN */
@@ -109,9 +108,8 @@ static u_char dt_to_ext2_ft[] = {
EXT2_FT_UNKNOWN, /* unused */
EXT2_FT_UNKNOWN, /* DT_WHT */
};
-#define DTTOFT(dt) \
- ((dt) > sizeof(dt_to_ext2_ft) / sizeof(dt_to_ext2_ft[0]) ? \
- EXT2_FT_UNKNOWN : dt_to_ext2_ft[(dt)])
+#define DTTOFT(dt) \
+ ((dt) > nitems(dt_to_ext2_ft) ? EXT2_FT_UNKNOWN : dt_to_ext2_ft[(dt)])
static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de,
int entryoffsetinblock);