Skip to contentSkip to conversation

sparc/vdso: add missing prototypes

PATCH In review Randy Dunlap 2 participants 3 messages Dec 9, 2025 – Dec 22, 2025 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc/vdso: add missing prototypes

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]

---
Cc: "David S. Miller" <[email protected]>
Cc: Andreas Larsson <[email protected]>
Cc: [email protected]

---
 arch/sparc/include/asm/vdso.h    |   11 +++++++++++
 arch/sparc/vdso/vclock_gettime.c |    1 +
 2 files changed, 12 insertions(+)
arch/sparc/vdso/vclock_gettime.c +1 -0
@@ -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
arch/sparc/include/asm/vdso.h +11 -0
@@ -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 */
#1 lore raw

Hi Randy,

Quoted 6 lines · Randy Dunlap

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.

Quoted 10 lines

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]

This issue would also be fixed by my patch series adopting the generic vDSO library on SPARC [0].
Picking up your patch would introduce conflicts.

[0] https://lore.kernel.org/lkml/[email protected]/

Thomas

#2 lore raw
Quoted 20 lines · Thomas Weißschuh

Hi Randy,

Quoted 6 lines · Randy Dunlap

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.

Quoted 10 lines

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]

Quoted 5 lines

This issue would also be fixed by my patch series adopting the generic vDSO library on SPARC [0].
Picking up your patch would introduce conflicts.

[0] https://lore.kernel.org/lkml/[email protected]/

OK, thanks for the info.
Patch dropped.

Signature · 1 line
~Randy