Message ID | 62275c5073d7bb4bb2df00b9805ceeb3ef46a422.1441187401.git.zhaolei@cn.fujitsu.com (mailing list archive) |
---|---|
State | Superseded |
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(-)