[v2,1/2] clock_getres01: drop case which is passing NULL res parameter
diff mbox series

Message ID ee463189a82212a10c1ac06229dc0a418e18305b.1565361031.git.jstancek@redhat.com
State Changes Requested
Headers show
Series
  • [v2,1/2] clock_getres01: drop case which is passing NULL res parameter
Related show

Commit Message

Jan Stancek Aug. 9, 2019, 2:31 p.m. UTC
Since commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer checks")
VDSO treats NULL parameter differently than in syscall.

Drop NULL parameter, subsequent patch will add test variants that test NULL
res parameter using syscall.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/clock_getres/clock_getres01.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Li Wang Aug. 12, 2019, 4:52 a.m. UTC | #1
On Fri, Aug 9, 2019 at 10:32 PM Jan Stancek <jstancek@redhat.com> wrote:
>
> Since commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer checks")
> VDSO treats NULL parameter differently than in syscall.
>
> Drop NULL parameter, subsequent patch will add test variants that test NULL
> res parameter using syscall.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Li Wang <liwang@redhat.com>
Cyril Hrubis Aug. 13, 2019, 12:12 p.m. UTC | #2
Hi!
> Since commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer checks")
> VDSO treats NULL parameter differently than in syscall.
> 
> Drop NULL parameter, subsequent patch will add test variants that test NULL
> res parameter using syscall.
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  testcases/kernel/syscalls/clock_getres/clock_getres01.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> index 15f32310839a..df3e84271ad9 100644
> --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> @@ -28,7 +28,6 @@ static struct test_case {
>  	{"MONOTONIC", CLOCK_MONOTONIC, &res, 0, 0},
>  	{"PROCESS_CPUTIME_ID", CLOCK_PROCESS_CPUTIME_ID, &res, 0, 0},
>  	{"THREAD_CPUTIME_ID", CLOCK_THREAD_CPUTIME_ID, &res, 0, 0},
> -	{"REALTIME", CLOCK_REALTIME, NULL, 0, 0},

Shouldn't we keep the REALTIME clock here and pass the &res here
instead?

>  	{"CLOCK_MONOTONIC_RAW", CLOCK_MONOTONIC_RAW, &res, 0, 0,},
>  	{"CLOCK_REALTIME_COARSE", CLOCK_REALTIME_COARSE, &res, 0, 0,},
>  	{"CLOCK_MONOTONIC_COARSE", CLOCK_MONOTONIC_COARSE, &res, 0, 0,},
> -- 
> 1.8.3.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp
Jan Stancek Aug. 13, 2019, 12:26 p.m. UTC | #3
----- Original Message -----
> Hi!
> > Since commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer
> > checks")
> > VDSO treats NULL parameter differently than in syscall.
> > 
> > Drop NULL parameter, subsequent patch will add test variants that test NULL
> > res parameter using syscall.
> > 
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > ---
> >  testcases/kernel/syscalls/clock_getres/clock_getres01.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> > b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> > index 15f32310839a..df3e84271ad9 100644
> > --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> > +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> > @@ -28,7 +28,6 @@ static struct test_case {
> >  	{"MONOTONIC", CLOCK_MONOTONIC, &res, 0, 0},
> >  	{"PROCESS_CPUTIME_ID", CLOCK_PROCESS_CPUTIME_ID, &res, 0, 0},
> >  	{"THREAD_CPUTIME_ID", CLOCK_THREAD_CPUTIME_ID, &res, 0, 0},
> > -	{"REALTIME", CLOCK_REALTIME, NULL, 0, 0},
> 
> Shouldn't we keep the REALTIME clock here and pass the &res here
> instead?

Test already has that as 1st entry in tcase array:
   {"REALTIME", CLOCK_REALTIME, &res, 0, 0},

> Can we please print which variant we are about to test from the test
> setup() as well?

Sure, I'll add that.
Cyril Hrubis Aug. 13, 2019, 1:13 p.m. UTC | #4
Hi!
> > Shouldn't we keep the REALTIME clock here and pass the &res here
> > instead?
> 
> Test already has that as 1st entry in tcase array:
>    {"REALTIME", CLOCK_REALTIME, &res, 0, 0},

Missed that, sorry.

> > Can we please print which variant we are about to test from the test
> > setup() as well?
> 
> Sure, I'll add that.

Consider the patch acked then.
Jan Stancek Aug. 13, 2019, 1:39 p.m. UTC | #5
----- Original Message -----
> Hi!
> > > Shouldn't we keep the REALTIME clock here and pass the &res here
> > > instead?
> > 
> > Test already has that as 1st entry in tcase array:
> >    {"REALTIME", CLOCK_REALTIME, &res, 0, 0},
> 
> Missed that, sorry.

Me as well in v1 :-)

> 
> > > Can we please print which variant we are about to test from the test
> > > setup() as well?
> > 
> > Sure, I'll add that.
> 
> Consider the patch acked then.

Both pushed.

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
>

Patch
diff mbox series

diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
index 15f32310839a..df3e84271ad9 100644
--- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
+++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
@@ -28,7 +28,6 @@  static struct test_case {
 	{"MONOTONIC", CLOCK_MONOTONIC, &res, 0, 0},
 	{"PROCESS_CPUTIME_ID", CLOCK_PROCESS_CPUTIME_ID, &res, 0, 0},
 	{"THREAD_CPUTIME_ID", CLOCK_THREAD_CPUTIME_ID, &res, 0, 0},
-	{"REALTIME", CLOCK_REALTIME, NULL, 0, 0},
 	{"CLOCK_MONOTONIC_RAW", CLOCK_MONOTONIC_RAW, &res, 0, 0,},
 	{"CLOCK_REALTIME_COARSE", CLOCK_REALTIME_COARSE, &res, 0, 0,},
 	{"CLOCK_MONOTONIC_COARSE", CLOCK_MONOTONIC_COARSE, &res, 0, 0,},