[PATCH] selftests: vDSO: vdso_test_correctness: Include linux/types.h

Ovidiu Panait <[email protected]>
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
When cross compiling the vDSO tests with a Yocto Scarthgap SDK, the
following build errors are encountered:

make headers
make -C tools/testing/selftests CC="${CC}" TARGETS="vDSO"
  CC       vdso_test_correctness
vdso_test_correctness.c:58:27: error: unknown type name
‘__kernel_time_t’
   58 | typedef time_t (*vtime_t)(__kernel_time_t *tloc);
      |                           ^~~~~~~~~~~~~~~
vdso_test_correctness.c:60:1: error: unknown type name ‘vtime_t’;
did you mean ‘time_t’?
   60 | vtime_t vdso_time;
      | ^~~~~~~
      | time_t

The code uses __kernel_time_t without including the header that declares
it. Fix this by including <linux/types.h>.

Fixes: bed0053a6303 ("selftests: vDSO: vdso_test_correctness: Add a test for time()")
Signed-off-by: Ovidiu Panait <[email protected]>
---
 tools/testing/selftests/vDSO/vdso_test_correctness.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 5c5a07dd1128..952ff5784a0b 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -18,6 +18,7 @@
 #include <sched.h>
 #include <stdbool.h>
 #include <limits.h>
+#include <linux/types.h>
 
 #include "parse_vdso.h"
 #include "vdso_config.h"
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.