Skip to contentSkip to conversation

btrfs: remove redundant check on ret and goto

PATCH In review Colin King 2 participants 2 messages Jan 12, 2018 – Feb 6, 2018

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 btrfs: remove redundant check on ret and goto

From: Colin Ian King <[email protected]>

The check for a non-zero ret is redundant as the goto will jump to the very next statement anyway. Remove this extraneous code.

Detected by CoverityScan, CID#1463784 ("Identical code for different branches")

---
 fs/btrfs/tests/btrfs-tests.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/tests/btrfs-tests.c +1 -2
index 9786d8cd0aa6..e74278170806 100644
@@ -278,8 +278,7 @@ int btrfs_run_sanity_tests(void)
 		}
 	}
 	ret = btrfs_test_extent_map();
-	if (ret)
-		goto out;
+
 out:
 	btrfs_destroy_test_fs();
 	return ret;
Signature · 1 line
2.15.1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The check for a non-zero ret is redundant as the goto will jump to the very next statement anyway. Remove this extraneous code.

Detected by CoverityScan, CID#1463784 ("Identical code for different branches")

Added to next, thanks.