Skip to content

Commit

Permalink
exfat: simplify is_valid_cluster()
Browse files Browse the repository at this point in the history
Simplify is_valid_cluster().

Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
  • Loading branch information
Christophe Vu-Brugier authored and Namjae Jeon committed Jan 10, 2022
1 parent df0cc57 commit e21a28b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/exfat/fatent.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ int exfat_ent_set(struct super_block *sb, unsigned int loc,
static inline bool is_valid_cluster(struct exfat_sb_info *sbi,
unsigned int clus)
{
if (clus < EXFAT_FIRST_CLUSTER || sbi->num_clusters <= clus)
return false;
return true;
return clus >= EXFAT_FIRST_CLUSTER && clus < sbi->num_clusters;
}

int exfat_ent_get(struct super_block *sb, unsigned int loc,
Expand Down

0 comments on commit e21a28b

Please sign in to comment.