提交 e0fcfe1f 编写于 作者: C Colin Ian King 提交者: Linus Torvalds

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: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7634ccd2
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册