diff mbox

[btrfs-next] btrfs: remove redundant check on ret and goto

Message ID 20180112165258.27431-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Colin King Jan. 12, 2018, 4:52 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/btrfs/tests/btrfs-tests.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

David Sterba Feb. 6, 2018, 2:44 p.m. UTC | #1
On Fri, Jan 12, 2018 at 04:52:58PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Added to next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index 9786d8cd0aa6..e74278170806 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -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;