From: Richard Palethorpe <rpalethorpe@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
Date: Mon, 16 Jan 2023 10:53:07 +0000 [thread overview]
Message-ID: <87o7qywxr7.fsf@suse.de> (raw)
In-Reply-To: <20230111091341.13346-1-pvorel@suse.cz>
Hello,
I have merged this and my/Petr's aiocp patches.
Petr I'm not sure what motivated some of these changes? Although clearly
the code was incorrect, I don't see the test failures in OpenQA?
Petr Vorel <pvorel@suse.cz> writes:
> 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) {
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-01-16 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-01-16 16:20 ` Petr Vorel
2023-01-17 13:57 ` Richard Palethorpe
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=87o7qywxr7.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.