From e0fcfe1f1acf2f129e0809ea89b9187e89e84246 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Sat, 25 Aug 2018 12:24:31 +0200 Subject: hpfs: remove unnecessary checks on the value of r when assigning error code At the point where r is being checked for different values, r is always going to be equal to 2 as the previous if statements jump to end or end1 if r is not 2. Hence the assignment to err can be simplified to just err an assignment without any checks on the value or r. Detected by CoverityScan, CID#1226737 ("Logically dead code") Signed-off-by: Colin Ian King Reviewed-by: Mikulas Patocka Signed-off-by: Linus Torvalds --- fs/hpfs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/hpfs') diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 082b7c76dd0c..1aee39160ac5 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -565,7 +565,7 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, err = -EFSERROR; goto end1; } - err = r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0; + err = -ENOSPC; goto end1; } -- cgit v1.2.3-55-g7522