public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
@ 2023-01-11  9:13 Petr Vorel
  2023-01-16 10:53 ` Richard Palethorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2023-01-11  9:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-17 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11  9:13 [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable Petr Vorel
2023-01-16 10:53 ` Richard Palethorpe
2023-01-16 16:20   ` Petr Vorel
2023-01-17 13:57     ` Richard Palethorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox