Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <colin.king@canonical.com>
Reviewed-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Colin Ian King and committed by
Linus Torvalds
e0fcfe1f 7634ccd2

+1 -1
+1 -1
fs/hpfs/namei.c
··· 565 565 err = -EFSERROR; 566 566 goto end1; 567 567 } 568 - err = r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0; 568 + err = -ENOSPC; 569 569 goto end1; 570 570 } 571 571