[PATCH] arm64: asm: vdso: gettimeofday: export common variables

Anders Roxell anders.roxell at linaro.org
Thu Oct 7 12:57:54 PDT 2021


When building the kernel with sparse enabled 'C=1' the following
warnings can be seen:

arch/arm64/kernel/vdso/vgettimeofday.c:9:5: warning: symbol '__kernel_clock_gettime' was not declared. Should it be static?
arch/arm64/kernel/vdso/vgettimeofday.c:15:5: warning: symbol '__kernel_gettimeofday' was not declared. Should it be static?
arch/arm64/kernel/vdso/vgettimeofday.c:21:5: warning: symbol '__kernel_clock_getres' was not declared. Should it be static?

Rework so the variables are exported, since these variables are
created and used in vdso/vgettimeofday.c, also used in vdso.lds.S.

Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
---
 arch/arm64/include/asm/vdso/gettimeofday.h | 7 +++++++
 arch/arm64/kernel/vdso/vgettimeofday.c     | 1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm64/include/asm/vdso/gettimeofday.h b/arch/arm64/include/asm/vdso/gettimeofday.h
index 4f7a629df81f..da8dfb119c30 100644
--- a/arch/arm64/include/asm/vdso/gettimeofday.h
+++ b/arch/arm64/include/asm/vdso/gettimeofday.h
@@ -12,6 +12,13 @@
 
 #define VDSO_HAS_CLOCK_GETRES		1
 
+extern int __kernel_clock_gettime(clockid_t clock,
+				  struct __kernel_timespec *ts);
+extern int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
+				 struct timezone *tz);
+extern int __kernel_clock_getres(clockid_t clock_id,
+				 struct __kernel_timespec *res);
+
 static __always_inline
 int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
 			  struct timezone *_tz)
diff --git a/arch/arm64/kernel/vdso/vgettimeofday.c b/arch/arm64/kernel/vdso/vgettimeofday.c
index 4236cf34d7d9..1a44d1e32746 100644
--- a/arch/arm64/kernel/vdso/vgettimeofday.c
+++ b/arch/arm64/kernel/vdso/vgettimeofday.c
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 ARM Limited
  *
  */
+#include <asm/vdso/gettimeofday.h>
 
 int __kernel_clock_gettime(clockid_t clock,
 			   struct __kernel_timespec *ts)
-- 
2.33.0




More information about the linux-arm-kernel mailing list