Using syscall(SYS_getcpu) is problematic for the reasons outlined in
vdso_syscalls.h.

Use the wrappers from the utility header instead.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
 tools/testing/selftests/vDSO/vdso_test_abi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c 
b/tools/testing/selftests/vDSO/vdso_test_abi.c
index 
ff142b3b9075b18e60a46b77492d285e9937fa71..5a1bd0c2742ae14053d826c8d9f3bdc1018d91f3
 100644
--- a/tools/testing/selftests/vDSO/vdso_test_abi.c
+++ b/tools/testing/selftests/vDSO/vdso_test_abi.c
@@ -19,6 +19,7 @@
 #include "../kselftest.h"
 #include "vdso_config.h"
 #include "vdso_call.h"
+#include "vdso_syscalls.h"
 #include "vdso_types.h"
 #include "parse_vdso.h"
 
@@ -157,7 +158,7 @@ static void vdso_test_clock_getres(__kernel_clockid_t 
clk_id)
        }
 
        struct __kernel_old_timespec ts;
-       struct timespec sys_ts;
+       struct __kernel_timespec sys_ts;
        long ret = VDSO_CALL(vdso_clock_getres, 2, clk_id, &ts);
 
        if (ret == 0) {
@@ -167,7 +168,7 @@ static void vdso_test_clock_getres(__kernel_clockid_t 
clk_id)
                clock_getres_fail++;
        }
 
-       ret = syscall(SYS_clock_getres, clk_id, &sys_ts);
+       ret = sys_clock_getres(clk_id, &sys_ts);
        if (ret == 0) {
                ksft_print_msg("The syscall resolution is %lld %lld\n",
                                (long long)sys_ts.tv_sec, (long 
long)sys_ts.tv_nsec);

-- 
2.51.0


Reply via email to