[PATCH 10/10] sparc64: Fix prototype warnings for vdso

Sam Ravnborg via B4 Relay posted 10 patches 1 year, 8 months ago
[PATCH 10/10] sparc64: Fix prototype warnings for vdso
Posted by Sam Ravnborg via B4 Relay 1 year, 8 months ago
From: Sam Ravnborg <sam@ravnborg.org>

Fix the following warnings:
arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for ‘__vdso_clock_gettime’
arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for ‘__vdso_clock_gettime_stick’
arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for ‘__vdso_gettimeofday’
arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for ‘__vdso_gettimeofday_stick’
arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: error: no previous prototype for ‘__vdso_clock_gettime’
arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: error: no previous prototype for ‘__vdso_clock_gettime_stick’
arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: error: no previous prototype for ‘__vdso_gettimeofday’
arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: error: no previous prototype for ‘__vdso_gettimeofday_stick’

The warnings were fixed by adding the proper prototypes to asm/vdso.h.
The better fix would be to convert sparc to be y2038 compliant so the
generic variant of vdso.h could be used.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/sparc/include/asm/vdso.h    | 10 ++++++++++
 arch/sparc/vdso/vclock_gettime.c |  1 +
 2 files changed, 11 insertions(+)

diff --git a/arch/sparc/include/asm/vdso.h b/arch/sparc/include/asm/vdso.h
index 59e79d35cd73..af630cad185c 100644
--- a/arch/sparc/include/asm/vdso.h
+++ b/arch/sparc/include/asm/vdso.h
@@ -5,6 +5,16 @@
 #ifndef _ASM_SPARC_VDSO_H
 #define _ASM_SPARC_VDSO_H
 
+#include <linux/linkage.h>
+#include <linux/time.h>
+#include <linux/time_types.h>
+#include <linux/types.h>
+
+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);
+
 struct vdso_image {
 	void *data;
 	unsigned long size;   /* Always a multiple of PAGE_SIZE */
diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gettime.c
index e794edde6755..a3f85d9cea52 100644
--- a/arch/sparc/vdso/vclock_gettime.c
+++ b/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

-- 
2.34.1


Re: [PATCH 10/10] sparc64: Fix prototype warnings for vdso
Posted by Arnd Bergmann 1 year, 8 months ago
On Sat, Mar 30, 2024, at 10:57, Sam Ravnborg via B4 Relay wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
>
> Fix the following warnings:
> arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype 
> for ‘__vdso_clock_gettime’
> arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype 
> for ‘__vdso_clock_gettime_stick’
> arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype 
> for ‘__vdso_gettimeofday’
> arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype 
> for ‘__vdso_gettimeofday_stick’
> arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: error: no previous 
> prototype for ‘__vdso_clock_gettime’
> arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: error: no previous 
> prototype for ‘__vdso_clock_gettime_stick’
> arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: error: no previous 
> prototype for ‘__vdso_gettimeofday’
> arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: error: no previous 
> prototype for ‘__vdso_gettimeofday_stick’
>
> The warnings were fixed by adding the proper prototypes to asm/vdso.h.
> The better fix would be to convert sparc to be y2038 compliant so the
> generic variant of vdso.h could be used.

I would prefer leaving the warning here until it is fixed
properly, or possibly removing the broken compat vdso
support. The other patches look fine though.

      Arnd