* [PATCH][btrfs-next] btrfs: remove redundant check on ret and goto
@ 2018-01-12 16:52 Colin King
2018-02-06 14:44 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-12 16:52 UTC (permalink / raw)
To: Chris Mason, Josef Bacik, David Sterba, Liu Bo, linux-btrfs
Cc: kernel-janitors, linux-kernel
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(-)
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;
--
2.15.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][btrfs-next] btrfs: remove redundant check on ret and goto
2018-01-12 16:52 [PATCH][btrfs-next] btrfs: remove redundant check on ret and goto Colin King
@ 2018-02-06 14:44 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-02-06 14:44 UTC (permalink / raw)
To: Colin King
Cc: Chris Mason, Josef Bacik, David Sterba, Liu Bo, linux-btrfs,
kernel-janitors, linux-kernel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-06 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 16:52 [PATCH][btrfs-next] btrfs: remove redundant check on ret and goto Colin King
2018-02-06 14:44 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).