Skip to contentSkip to conversation

fatfs: remove redundant judgment

PATCH Applied fengyubo 2 participants 2 messages Mar 26, 2022 VFAT/FAT/msdos filesystem

lore
Share & tools
lore

fengyubo

author
#0 lore raw

PATCH 1/1 fatfs: remove redundant judgment

From: Yubo Feng <[email protected]>

iput() has already judged the incoming parameter, so there is no need to repeat outside.

---
 fs/fat/inode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/fat/inode.c +2 -4
index a6f1c6d426d1..da8619148590 100644
@@ -1888,10 +1888,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
 		fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem");
 
 out_fail:
-	if (fsinfo_inode)
-		iput(fsinfo_inode);
-	if (fat_inode)
-		iput(fat_inode);
+	iput(fsinfo_inode);
+	iput(fat_inode);
 	unload_nls(sbi->nls_io);
 	unload_nls(sbi->nls_disk);
 	fat_reset_iocharset(&sbi->options);
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · fengyubo

From: Yubo Feng <[email protected]>

iput() has already judged the incoming parameter, so there is no need to repeat outside.

Thanks.

Quoted 21 lines
---
 fs/fat/inode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/fat/inode.c +2 -4
index a6f1c6d426d1..da8619148590 100644
@@ -1888,10 +1888,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
 		fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem");
 
 out_fail:
-	if (fsinfo_inode)
-		iput(fsinfo_inode);
-	if (fat_inode)
-		iput(fat_inode);
+	iput(fsinfo_inode);
+	iput(fat_inode);
 	unload_nls(sbi->nls_io);
 	unload_nls(sbi->nls_disk);
 	fat_reset_iocharset(&sbi->options);
Signature · 1 line
OGAWA Hirofumi <[email protected]>