* [PATCH] testsuite/smokey/y2038: Clean up error tests
@ 2021-06-04 12:07 Jan Kiszka
2021-06-04 12:28 ` Florian Bezdeka
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2021-06-04 12:07 UTC (permalink / raw)
To: Xenomai
From: Jan Kiszka <jan.kiszka@siemens.com>
No checks of ret against 0 needed in those cases.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
testsuite/smokey/y2038/syscall-tests.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testsuite/smokey/y2038/syscall-tests.c b/testsuite/smokey/y2038/syscall-tests.c
index e81d23557..24580f5a8 100644
--- a/testsuite/smokey/y2038/syscall-tests.c
+++ b/testsuite/smokey/y2038/syscall-tests.c
@@ -105,7 +105,7 @@ static int test_sc_cobalt_sem_timedwait64(void)
sem_post(&sem);
ret = XENOMAI_SYSCALL2(sc_nr, &sem, NULL);
if (!smokey_assert(!ret))
- return ret ? ret : -EINVAL;
+ return ret;
/*
* The semaphore is already exhausted, so calling again will validate
@@ -189,7 +189,7 @@ static int test_sc_cobalt_clock_gettime64(void)
/* Provide a valid 64bit timespec */
ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_MONOTONIC, &ts64);
if (!smokey_assert(!ret))
- return ret ? ret : -EINVAL;
+ return ret;
/* Validate seconds only, nanoseconds might still be zero */
smokey_assert(ts64.tv_sec != 0);
@@ -227,7 +227,7 @@ static int test_sc_cobalt_clock_settime64(void)
ts64.tv_nsec = now.tv_nsec;
ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_REALTIME, &ts64);
if (!smokey_assert(!ret))
- return ret ? ret : -EINVAL;
+ return ret;
ret = clock_gettime(CLOCK_REALTIME, &now);
if (ret)
@@ -276,7 +276,7 @@ static int test_sc_cobalt_clock_nanosleep64(void)
ret = XENOMAI_SYSCALL4(sc_nr, CLOCK_MONOTONIC, TIMER_ABSTIME,
&next, (void *)0xdeadbeefUL);
if (!smokey_assert(!ret))
- return ret ? ret : -EINVAL;
+ return ret;
ret = clock_gettime(CLOCK_MONOTONIC, &ts2);
if (ret)
@@ -292,7 +292,7 @@ static int test_sc_cobalt_clock_nanosleep64(void)
ret = XENOMAI_SYSCALL4(sc_nr, CLOCK_MONOTONIC, TIMER_ABSTIME, &next, &rmt);
if (!smokey_assert(!ret))
- return ret ? ret : -EINVAL;
+ return ret;
ret = clock_gettime(CLOCK_MONOTONIC, &ts1);
if (ret)
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] testsuite/smokey/y2038: Clean up error tests
2021-06-04 12:07 [PATCH] testsuite/smokey/y2038: Clean up error tests Jan Kiszka
@ 2021-06-04 12:28 ` Florian Bezdeka
0 siblings, 0 replies; 2+ messages in thread
From: Florian Bezdeka @ 2021-06-04 12:28 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
On 04.06.21 14:07, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> No checks of ret against 0 needed in those cases.
ACK. We will take care in future series.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> testsuite/smokey/y2038/syscall-tests.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testsuite/smokey/y2038/syscall-tests.c b/testsuite/smokey/y2038/syscall-tests.c
> index e81d23557..24580f5a8 100644
> --- a/testsuite/smokey/y2038/syscall-tests.c
> +++ b/testsuite/smokey/y2038/syscall-tests.c
> @@ -105,7 +105,7 @@ static int test_sc_cobalt_sem_timedwait64(void)
> sem_post(&sem);
> ret = XENOMAI_SYSCALL2(sc_nr, &sem, NULL);
> if (!smokey_assert(!ret))
> - return ret ? ret : -EINVAL;
> + return ret;
>
> /*
> * The semaphore is already exhausted, so calling again will validate
> @@ -189,7 +189,7 @@ static int test_sc_cobalt_clock_gettime64(void)
> /* Provide a valid 64bit timespec */
> ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_MONOTONIC, &ts64);
> if (!smokey_assert(!ret))
> - return ret ? ret : -EINVAL;
> + return ret;
>
> /* Validate seconds only, nanoseconds might still be zero */
> smokey_assert(ts64.tv_sec != 0);
> @@ -227,7 +227,7 @@ static int test_sc_cobalt_clock_settime64(void)
> ts64.tv_nsec = now.tv_nsec;
> ret = XENOMAI_SYSCALL2(sc_nr, CLOCK_REALTIME, &ts64);
> if (!smokey_assert(!ret))
> - return ret ? ret : -EINVAL;
> + return ret;
>
> ret = clock_gettime(CLOCK_REALTIME, &now);
> if (ret)
> @@ -276,7 +276,7 @@ static int test_sc_cobalt_clock_nanosleep64(void)
> ret = XENOMAI_SYSCALL4(sc_nr, CLOCK_MONOTONIC, TIMER_ABSTIME,
> &next, (void *)0xdeadbeefUL);
> if (!smokey_assert(!ret))
> - return ret ? ret : -EINVAL;
> + return ret;
>
> ret = clock_gettime(CLOCK_MONOTONIC, &ts2);
> if (ret)
> @@ -292,7 +292,7 @@ static int test_sc_cobalt_clock_nanosleep64(void)
>
> ret = XENOMAI_SYSCALL4(sc_nr, CLOCK_MONOTONIC, TIMER_ABSTIME, &next, &rmt);
> if (!smokey_assert(!ret))
> - return ret ? ret : -EINVAL;
> + return ret;
>
> ret = clock_gettime(CLOCK_MONOTONIC, &ts1);
> if (ret)
>
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-04 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 12:07 [PATCH] testsuite/smokey/y2038: Clean up error tests Jan Kiszka
2021-06-04 12:28 ` Florian Bezdeka
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.