Message ID | 9446bb8f52e149e387b38f60ab456a7c67022683.1441186744.git.zhaolei@cn.fujitsu.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
diff --git a/chunk-recover.c b/chunk-recover.c index 832b3b1..66a4ce6 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -871,8 +871,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; @@ -880,7 +879,6 @@ static int scan_devices(struct recover_control *rc) cancel_to = devnr - 1; goto out1; } - i++; } out1: while (ret && (cancel_from <= cancel_to)) {
for() is more suitable than while() in this code block. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> --- chunk-recover.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)