[LTP] [PATCH v2 1/1] aio-stress.c: Remove useless iteration variable

Petr Vorel pvorel@suse.cz
Fri Dec 23 19:33:25 CET 2022


local iteration variable in worker() was probably left over from
previous version before rewrite because clang correctly reported also on
this old version:

    aio-stress.c:1049:6: warning: variable 'iteration' set but not used [-Wunused-but-set-variable]
    int iteration = 0;

Whole restart label was not used.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
* remove whole restart label.

 testcases/kernel/io/ltp-aiodio/aio-stress.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
index 2fdbb84e87..2946ac1f47 100644
--- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
+++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
@@ -1039,12 +1039,10 @@ static int *worker(struct thread_info *t)
 	char *this_stage = NULL;
 	struct timeval stage_time;
 	int status = 0;
-	int iteration = 0;
 	int cnt;
 
 	aio_setup(&t->io_ctx, 512);
 
-restart:
 	if (num_threads > 1) {
 		if (pthread_barrier_wait(&worker_barrier))
 			gettimeofday(&global_stage_start_time, NULL);
@@ -1115,12 +1113,6 @@ restart:
 			global_thread_throughput(t, this_stage);
 	}
 
-	/* someone got restarted, go back to the beginning */
-	if (t->active_opers && cnt < iterations) {
-		iteration++;
-		goto restart;
-	}
-
 	/* finally, free all the ram */
 	while (t->finished_opers) {
 		oper = t->finished_opers;
-- 
2.39.0



More information about the ltp mailing list