aboutsummaryrefslogtreecommitdiff
path: root/fs/exfat/fatent.c
diff options
context:
space:
mode:
authorGravatar Christophe Vu-Brugier <christophe.vu-brugier@seagate.com> 2021-11-02 22:23:55 +0100
committerGravatar Namjae Jeon <linkinjeon@kernel.org> 2022-01-10 11:00:00 +0900
commite21a28bbcc0c5dc8ab86af77edb530d6fc0c20ff (patch)
tree7a7d1ae5dc00b666c4941f23c75d26fa1ccff484 /fs/exfat/fatent.c
parentLinux 5.16 (diff)
downloadlinux-e21a28bbcc0c5dc8ab86af77edb530d6fc0c20ff.tar.gz
linux-e21a28bbcc0c5dc8ab86af77edb530d6fc0c20ff.tar.bz2
linux-e21a28bbcc0c5dc8ab86af77edb530d6fc0c20ff.zip
exfat: simplify is_valid_cluster()
Simplify is_valid_cluster(). Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat/fatent.c')
-rw-r--r--fs/exfat/fatent.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index e949e563443c..a3464e56a7e1 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -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,