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

Petr Vorel pvorel@suse.cz
Wed Jan 11 10:13:41 CET 2023


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;

NOTE: restart label was considered to be removed, but in the end kept.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v2->v3:
* Keep restart label (remove only the variable)

 testcases/kernel/io/ltp-aiodio/aio-stress.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
index d84d5a0741..5c3a0a3a49 100644
--- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
+++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
@@ -1039,7 +1039,6 @@ 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);
@@ -1116,10 +1115,8 @@ restart:
 	}
 
 	/* someone got restarted, go back to the beginning */
-	if (t->active_opers && cnt < iterations) {
-		iteration++;
+	if (t->active_opers && cnt < iterations)
 		goto restart;
-	}
 
 	/* finally, free all the ram */
 	while (t->finished_opers) {
-- 
2.39.0



More information about the ltp mailing list