diff mbox series

khugepaged: selftests: fix timeout condition in wait_for_scan()

Message ID 20200605110736.GH978434@mwanda
State New
Headers show
Series khugepaged: selftests: fix timeout condition in wait_for_scan() | expand

Commit Message

Dan Carpenter June 5, 2020, 11:07 a.m. UTC
The loop exits with "timeout" set to -1 and not to 0 so the test needs
to be fixed.

Fixes: e7b592f6caca ("khugepaged: add self test")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 tools/testing/selftests/vm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/vm/khugepaged.c b/tools/testing/selftests/vm/khugepaged.c
index 51b89cedd09d1..8b75821302a79 100644
--- a/tools/testing/selftests/vm/khugepaged.c
+++ b/tools/testing/selftests/vm/khugepaged.c
@@ -502,7 +502,7 @@  static bool wait_for_scan(const char *msg, char *p)
 
 	madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE);
 
-	return !timeout;
+	return timeout == -1;
 }
 
 static void alloc_at_fault(void)