[PATCH] sparc/vdso: add missing prototypes

Randy Dunlap posted 1 patch 1 week, 3 days ago
arch/sparc/include/asm/vdso.h    |   11 +++++++++++
arch/sparc/vdso/vclock_gettime.c |    1 +
2 files changed, 12 insertions(+)
[PATCH] sparc/vdso: add missing prototypes
Posted by Randy Dunlap 1 week, 3 days ago
On sparc64, when CONFIG_WERROR=y, there are a few missing-prototype
build errors. Fix them.

Add the 4 missing prototypes to <asm/vdso.h> and include that header
file in vclock_gettime.c.

Fixes these build errors:
In file included from ../arch/sparc/vdso/vdso32/vclock_gettime.c:22:
../arch/sparc/vdso/vdso32/../vclock_gettime.c:274:1: error: no previous
 prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
../arch/sparc/vdso/vdso32/../vclock_gettime.c:302:1: error: no previous
 prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes]
../arch/sparc/vdso/vdso32/../vclock_gettime.c:327:1: error: no previous
 prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
../arch/sparc/vdso/vdso32/../vclock_gettime.c:363:1: error: no previous
 prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/include/asm/vdso.h    |   11 +++++++++++
 arch/sparc/vdso/vclock_gettime.c |    1 +
 2 files changed, 12 insertions(+)

--- linux-next-20251205.orig/arch/sparc/vdso/vclock_gettime.c
+++ linux-next-20251205/arch/sparc/vdso/vclock_gettime.c
@@ -19,6 +19,7 @@
 #include <asm/unistd.h>
 #include <asm/timex.h>
 #include <asm/clocksource.h>
+#include <asm/vdso.h>
 #include <asm/vvar.h>
 
 #ifdef	CONFIG_SPARC64
--- linux-next-20251205.orig/arch/sparc/include/asm/vdso.h
+++ linux-next-20251205/arch/sparc/include/asm/vdso.h
@@ -19,4 +19,15 @@ extern const struct vdso_image vdso_imag
 extern const struct vdso_image vdso_image_32_builtin;
 #endif
 
+struct __kernel_old_timespec;
+struct timezone;
+notrace int
+__vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts);
+notrace int
+__vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts);
+notrace int
+__vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
+notrace int
+__vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz);
+
 #endif /* _ASM_SPARC_VDSO_H */