From: kai.kang@windriver.com <kai.kang@windriver.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray
Date: Mon, 12 Nov 2018 15:56:00 +0800 [thread overview]
Message-ID: <20181112075600.1155-1-kai.kang@windriver.com> (raw)
From: Kai Kang <kai.kang@windriver.com>
There are some problems of the logic to use all values in keyarray. It
fails to run:
$ ./msgstress04 -n 1 -c 1 -l 1
Only the first MSGMNI members of keyarray are initialized. But it will
use the member whose index exceeds MSGMNI in keyarray.
Correct the logic to make sure to use the initialized members of
keyarray.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
testcases/kernel/syscalls/ipc/msgstress/msgstress04.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
index 18fad4fbd..81383d6c8 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
@@ -176,11 +176,11 @@ int main(int argc, char **argv)
} else {
for (i = 0; i < (MSGMNI / maxnprocs); i++) {
nprocs = maxnprocs;
- dotest_iteration(i*(MSGMNI / maxnprocs));
+ dotest_iteration(i * maxnprocs);
}
nprocs = MSGMNI % maxnprocs;
- dotest_iteration(i*(MSGMNI / maxnprocs));
+ dotest_iteration(i * maxnprocs);
}
tst_resm(TPASS, "Test ran successfully!");
--
2.17.0
next reply other threads:[~2018-11-12 7:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 7:56 kai.kang [this message]
2018-11-12 8:45 ` [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray Jan Stancek
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=20181112075600.1155-1-kai.kang@windriver.com \
--to=kai.kang@windriver.com \
--cc=ltp@lists.linux.it \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox