diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-09-02 20:22:29 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-09-02 18:56:54 +0200 |
commit | 1593aa711a8578008833d634ce0a04f97dd4a837 (patch) | |
tree | 7685a7312cc34137ee13b8612a3baaf4f350a42d /chunk-recover.c | |
parent | 17e1e872d4e88e9b5ec524dd9dfb3da40a295096 (diff) | |
download | btrfs-progs-1593aa711a8578008833d634ce0a04f97dd4a837.tar.gz |
btrfs-progs: use for loop for scan_devices
for() is more suitable than while() in this code block.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'chunk-recover.c')
-rw-r--r-- | chunk-recover.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/chunk-recover.c b/chunk-recover.c index 439599f..3f67432 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -873,8 +873,7 @@ static int scan_devices(struct recover_control *rc) devidx++; } - i = 0; - while (i < devidx) { + for (i = 0; i < devidx; i++) { ret = pthread_join(t_scans[i], (void **)&t_rets[i]); if (ret || t_rets[i]) { ret = 1; @@ -882,7 +881,6 @@ static int scan_devices(struct recover_control *rc) cancel_to = devnr - 1; goto out1; } - i++; } out1: while (ret && (cancel_from <= cancel_to)) { |