From: Richard Palethorpe <rpalethorpe@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] aio-stress.c: Use static variable iterations
Date: Mon, 12 Dec 2022 16:31:03 +0000 [thread overview]
Message-ID: <87k02wshw2.fsf@suse.de> (raw)
In-Reply-To: <20221212160322.4600-1-pvorel@suse.cz>
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> local iteration variable in worker() was probably left over from
> previous versions rewrite (maybe -i was not used in previous versions).
>
> Clang correctly reported:
> aio-stress.c:1049:6: warning: variable 'iteration' set but not used [-Wunused-but-set-variable]
> int iteration = 0;
>
> Fixes: 054d45390 ("Rewrite aio-stress test using LTP API")
>
> Reported-by: Richard Palethorpe <rpalethorpe@suse.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi,
>
> reported by Richie [1], I got confused thus merge before this fix.
>
> [1] https://lore.kernel.org/ltp/87h6yfifbr.fsf@suse.de/
>
> testcases/kernel/io/ltp-aiodio/aio-stress.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
> index 39db14d65..29e679087 100644
> --- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
> +++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
> @@ -1046,7 +1046,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);
> @@ -1151,7 +1150,7 @@ restart:
>
> /* someone got restarted, go back to the beginning */
> if (t->active_opers && cnt < iterations) {
> - iteration++;
> + iterations++;
Why is this correct?
> goto restart;
> }
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-12-12 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 16:03 [LTP] [PATCH 1/1] aio-stress.c: Use static variable iterations Petr Vorel
2022-12-12 16:31 ` Richard Palethorpe [this message]
2022-12-12 18:29 ` Petr Vorel
2022-12-12 18:52 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k02wshw2.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.