[PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions

Tian Tao tiantao6 at hisilicon.com
Tue Sep 15 07:24:30 EDT 2020


Add extern declarations for vDSO time-related functions to notify the
compiler these functions will be used in somewhere to fix
"no previous prototype" compile warning.

arch/arm64/kernel/vdso/vgettimeofday.c:9:5: warning: no previous
prototype for ‘__kernel_clock_gettime’ [-Wmissing-prototypes]
int __kernel_clock_gettime(clockid_t clock,
     ^
arch/arm64/kernel/vdso/vgettimeofday.c:15:5: warning: no previous
prototype for ‘__kernel_gettimeofday’ [-Wmissing-prototypes]
int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
     ^
arch/arm64/kernel/vdso/vgettimeofday.c:21:5: warning: no previous
prototype for ‘__kernel_clock_getres’ [-Wmissing-prototypes]
int __kernel_clock_getres(clockid_t clock_id,

Signed-off-by: Tian Tao <tiantao6 at hisilicon.com>
---
 arch/arm64/kernel/vdso/vgettimeofday.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/kernel/vdso/vgettimeofday.c b/arch/arm64/kernel/vdso/vgettimeofday.c
index 4236cf3..e808481 100644
--- a/arch/arm64/kernel/vdso/vgettimeofday.c
+++ b/arch/arm64/kernel/vdso/vgettimeofday.c
@@ -6,18 +6,27 @@
  *
  */
 
+extern
+int __kernel_clock_gettime(clockid_t clock,
+			   struct __kernel_timespec *ts);
 int __kernel_clock_gettime(clockid_t clock,
 			   struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
+extern
+int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
+			  struct timezone *tz);
 int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
 			  struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
+extern
+int __kernel_clock_getres(clockid_t clock_id,
+			  struct __kernel_timespec *res);
 int __kernel_clock_getres(clockid_t clock_id,
 			  struct __kernel_timespec *res)
 {
-- 
2.7.4




More information about the linux-arm-kernel mailing list