Skip to content

Commit 67c3c7d

Browse files
btw616richardweinberger
authored andcommitted
um: Fix -Wmissing-prototypes warnings for __vdso_*
The VDSO functions are defined as globals and intended to be called from userspace. Let's just workaround the -Wmissing-prototypes warnings by declaring them locally. This will address below -Wmissing-prototypes warnings: arch/x86/um/vdso/um_vdso.c:16:5: warning: no previous prototype for ‘__vdso_clock_gettime’ [-Wmissing-prototypes] arch/x86/um/vdso/um_vdso.c:30:5: warning: no previous prototype for ‘__vdso_gettimeofday’ [-Wmissing-prototypes] arch/x86/um/vdso/um_vdso.c:44:21: warning: no previous prototype for ‘__vdso_time’ [-Wmissing-prototypes] arch/x86/um/vdso/um_vdso.c:57:1: warning: no previous prototype for ‘__vdso_getcpu’ [-Wmissing-prototypes] While at it, also fix the "WARNING: Prefer 'unsigned int *' to bare use of 'unsigned *'" checkpatch warning. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 847d3ab commit 67c3c7d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/x86/um/vdso/um_vdso.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
#include <linux/getcpu.h>
1414
#include <asm/unistd.h>
1515

16+
/* workaround for -Wmissing-prototypes warnings */
17+
int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts);
18+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
19+
__kernel_old_time_t __vdso_time(__kernel_old_time_t *t);
20+
long __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused);
21+
1622
int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
1723
{
1824
long ret;
@@ -54,7 +60,7 @@ __kernel_old_time_t __vdso_time(__kernel_old_time_t *t)
5460
__kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alias("__vdso_time")));
5561

5662
long
57-
__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
63+
__vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused)
5864
{
5965
/*
6066
* UML does not support SMP, we can cheat here. :)
@@ -68,5 +74,5 @@ __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
6874
return 0;
6975
}
7076

71-
long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
77+
long getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *tcache)
7278
__attribute__((weak, alias("__vdso_getcpu")));

0 commit comments

Comments
 (0)