All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts
@ 2021-09-20 13:14 Richard Palethorpe via ltp
  2021-09-20 13:45 ` Petr Vorel
  2021-09-20 13:58 ` Cyril Hrubis
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Palethorpe via ltp @ 2021-09-20 13:14 UTC (permalink / raw)
  To: ltp; +Cc: Viresh Kumar, Richard Palethorpe

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(-)

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));
-- 
2.31.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts
  2021-09-20 13:14 [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts Richard Palethorpe via ltp
@ 2021-09-20 13:45 ` Petr Vorel
  2021-09-20 13:58 ` Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2021-09-20 13:45 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: Viresh Kumar, ltp

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts
  2021-09-20 13:14 [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts Richard Palethorpe via ltp
  2021-09-20 13:45 ` Petr Vorel
@ 2021-09-20 13:58 ` Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2021-09-20 13:58 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: Viresh Kumar, ltp

Hi!
Good catch, pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2021-09-20 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 13:14 [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts Richard Palethorpe via ltp
2021-09-20 13:45 ` Petr Vorel
2021-09-20 13:58 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.