* [PATCH] selftests/nolibc: mmap_munmap_good: fix up return value
@ 2023-07-25 16:43 Zhangjin Wu
2023-07-26 6:16 ` Thomas Weißschuh
0 siblings, 1 reply; 3+ messages in thread
From: Zhangjin Wu @ 2023-07-25 16:43 UTC (permalink / raw)
To: w; +Cc: linux-kernel, linux-kselftest, thomas, Zhangjin Wu
The other tests use 1 as failure, mmap_munmap_good uses -1 as failure,
let's fix up this.
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
Willy, if it is ok for you, please merge this one to our old queued commit:
commit 6b3e54d01905 ("selftests/nolibc: add mmap_munmap_good test case")
---
tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 03b1d30f5507..d892aa403095 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -725,7 +725,7 @@ int test_mmap_munmap(void)
page_size = getpagesize();
if (page_size < 0)
- return -1;
+ return 1;
/* find a right file to mmap, existed and accessible */
for (i = 0; files[i] != NULL; i++) {
@@ -736,7 +736,7 @@ int test_mmap_munmap(void)
break;
}
if (ret == -1)
- return ret;
+ return 1;
ret = stat(files[i], &stat_buf);
if (ret == -1)
@@ -756,7 +756,7 @@ int test_mmap_munmap(void)
mem = mmap(NULL, length + offset - pa_offset, PROT_READ, MAP_SHARED, fd, pa_offset);
if (mem == MAP_FAILED) {
- ret = -1;
+ ret = 1;
goto end;
}
@@ -764,7 +764,7 @@ int test_mmap_munmap(void)
end:
close(fd);
- return ret;
+ return !!ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/nolibc: mmap_munmap_good: fix up return value
2023-07-25 16:43 [PATCH] selftests/nolibc: mmap_munmap_good: fix up return value Zhangjin Wu
@ 2023-07-26 6:16 ` Thomas Weißschuh
2023-07-29 7:32 ` Willy Tarreau
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Weißschuh @ 2023-07-26 6:16 UTC (permalink / raw)
To: Zhangjin Wu; +Cc: w, linux-kernel, linux-kselftest
On 2023-07-26 00:43:36+0800, Zhangjin Wu wrote:
> The other tests use 1 as failure, mmap_munmap_good uses -1 as failure,
> let's fix up this.
>
> Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>
> Willy, if it is ok for you, please merge this one to our old queued commit:
>
> commit 6b3e54d01905 ("selftests/nolibc: add mmap_munmap_good test case")
>
> ---
> tools/testing/selftests/nolibc/nolibc-test.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/nolibc: mmap_munmap_good: fix up return value
2023-07-26 6:16 ` Thomas Weißschuh
@ 2023-07-29 7:32 ` Willy Tarreau
0 siblings, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2023-07-29 7:32 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: Zhangjin Wu, linux-kernel, linux-kselftest
On Wed, Jul 26, 2023 at 08:16:02AM +0200, Thomas Weißschuh wrote:
> On 2023-07-26 00:43:36+0800, Zhangjin Wu wrote:
> > The other tests use 1 as failure, mmap_munmap_good uses -1 as failure,
> > let's fix up this.
> >
> > Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
>
> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Applied, thanks to you both.
Willy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-29 7:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-25 16:43 [PATCH] selftests/nolibc: mmap_munmap_good: fix up return value Zhangjin Wu
2023-07-26 6:16 ` Thomas Weißschuh
2023-07-29 7:32 ` Willy Tarreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox