[LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts
    Richard Palethorpe 
    rpalethorpe@suse.com
       
    Mon Sep 20 15:14:12 CEST 2021
    
    
  
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
    
    
More information about the ltp
mailing list