Skip to contentSkip to conversation

f2fs: remove redundant parameter judgment

PATCH In review Wang Xiaojun via Linux-f2fs-devel 2 participants 2 messages Mar 14, 2022 – Mar 15, 2022 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: remove redundant parameter judgment

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

---
 fs/f2fs/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/namei.c +1 -2
index 5f213f05556d..b7c9b602bd72 100644
@@ -1107,8 +1107,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
 out_old:
 	f2fs_put_page(old_page, 0);
 out:
-	if (whiteout)
-		iput(whiteout);
+	iput(whiteout);
 	return err;
 }
 
Signature · 8 lines
2.26.0.106.g9fadedd



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On 2022/3/14 15:15, Wang Xiaojun via Linux-f2fs-devel wrote:

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

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel