From 9965f4aa56d4fb727deac9e8ee041d4ffd77a97c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 9 Mar 2010 21:20:55 -0800 Subject: [PATCH] fat: fix the type of get_inode_mode() get_inode_mode() returns enum dirent_type. Signed-off-by: H. Peter Anvin --- core/fs/fat/fat.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c index 97997d5..029c2d4 100644 --- a/core/fs/fat/fat.c +++ b/core/fs/fat/fat.c @@ -423,12 +423,9 @@ static inline sector_t first_sector(struct fs_info *fs, return sector; } -static inline int get_inode_mode(uint8_t attr) +static inline enum dirent_type get_inode_mode(uint8_t attr) { - if (attr == FAT_ATTR_DIRECTORY) - return DT_DIR; - else - return DT_REG; + return (attr & FAT_ATTR_DIRECTORY) ? DT_DIR : DT_REG; } @@ -590,7 +587,6 @@ static int vfat_readdir(struct file *file, struct dirent *dirent) uint8_t vfat_init, vfat_next, vfat_csum; uint8_t id; int entries_left; - int checksum; bool long_entry = false; int sec_off = file->offset & ((1 << fs->sector_shift) - 1); -- 2.7.4