public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray
@ 2018-11-12  7:56 kai.kang
  2018-11-12  8:45 ` Jan Stancek
  0 siblings, 1 reply; 2+ messages in thread
From: kai.kang @ 2018-11-12  7:56 UTC (permalink / raw)
  To: ltp

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray
  2018-11-12  7:56 [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray kai.kang
@ 2018-11-12  8:45 ` Jan Stancek
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Stancek @ 2018-11-12  8:45 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> 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
> 
> 

Pushed.

Thanks,
Jan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-12  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-12  7:56 [LTP] [PATCH v2] msgstress04: correct the logic to use all values in keyarray kai.kang
2018-11-12  8:45 ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox