All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Richard Palethorpe <rpalethorpe@suse.com>
Subject: [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts
Date: Mon, 20 Sep 2021 14:14:12 +0100	[thread overview]
Message-ID: <20210920131412.26186-1-rpalethorpe@suse.com> (raw)

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

             reply	other threads:[~2021-09-20 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 13:14 Richard Palethorpe via ltp [this message]
2021-09-20 13:45 ` [LTP] [PATCH] io_pgetevents02: Pass the union member of tst_ts Petr Vorel
2021-09-20 13:58 ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920131412.26186-1-rpalethorpe@suse.com \
    --to=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.