msgstress04: correct the logic to use all values in keyarray
PATCH v2 1/1 msgstress04: correct the logic to use all values in keyarray
From: Kai Kang <[email protected]>
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.
--- testcases/kernel/syscalls/ipc/msgstress/msgstress04.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/ipc/msgstress/msgstress04.c +2 -2
@@ -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!" );
Signature · 1 line
2.17.0
PATCH v2 1/1 msgstress04: correct the logic to use all values in keyarray
----- Original Message -----
Quoted 38 lines
From: Kai Kang <[email protected]>
There are some problems of the logic to use all values in keyarray. It fails to run:
$ ./msgstress04 -n 1 -c 1 -l 1Only 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 <[email protected]>--- testcases/kernel/syscalls/ipc/msgstress/msgstress04.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)testcases/kernel/syscalls/ipc/msgstress/msgstress04.c +2
-3@@ -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!" ); --
Quoted 3 lines
2.17.0
Pushed.
Thanks,
Jan