Message ID | 20210920131412.26186-1-rpalethorpe@suse.com |
---|---|
State | Accepted |
Headers | show |
Series | io_pgetevents02: Pass the union member of tst_ts | expand |
Hi Richard, > Currently we pass the whole tst_ts struct. The kernel expects the > union part of this struct. Thanks! Reviewed-by: Petr Vorel <pvorel@suse.cz> Kind regards, Petr
Hi! Good catch, pushed, thanks.
diff --git a/testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c b/testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c index af71e17fe..d763e150f 100644 --- a/testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c +++ b/testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c @@ -93,11 +93,8 @@ static void run(unsigned int n) { struct time64_variants *tv = &variants[tst_variant]; struct tcase *tc = &tcases[n]; - struct timespec *to; - sigset_t *sigmask; - - sigmask = tc->sigmask ? tc->sigmask : bad_addr; - to = tc->timeout ? tc->timeout : bad_addr; + void *const to = tc->timeout ? tst_ts_get(tc->timeout) : bad_addr; + sigset_t *const sigmask = tc->sigmask ? tc->sigmask : bad_addr; TEST(tv->io_pgetevents(*tc->ctx, tc->min_nr, tc->max_nr, tc->events, to, sigmask));
Currently we pass the whole tst_ts struct. The kernel expects the union part of this struct. Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> --- Note that because bad_addr is (void *) the whole ternary expression becomes (void *). The tc->timeout is then also implicitly cast to void. testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)