From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Stancek Date: Mon, 12 Nov 2018 03:45:12 -0500 (EST) Subject: [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray In-Reply-To: <20181112075600.1155-1-kai.kang@windriver.com> References: <20181112075600.1155-1-kai.kang@windriver.com> Message-ID: <973630772.72986739.1542012312980.JavaMail.zimbra@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it ----- Original Message ----- > From: Kai Kang > > 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 > --- > 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 > > Pushed. Thanks, Jan