Skip to content

Commit 84e7620

Browse files
committed
LoongArch: Fix build warnings in VDSO
Fix build warnings in VDSO as below: arch/loongarch/vdso/vgettimeofday.c:9:5: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes] 9 | int __vdso_clock_gettime(clockid_t clock, | ^~~~~~~~~~~~~~~~~~~~ arch/loongarch/vdso/vgettimeofday.c:15:5: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes] 15 | int __vdso_gettimeofday(struct __kernel_old_timeval *tv, | ^~~~~~~~~~~~~~~~~~~ arch/loongarch/vdso/vgettimeofday.c:21:5: warning: no previous prototype for '__vdso_clock_getres' [-Wmissing-prototypes] 21 | int __vdso_clock_getres(clockid_t clock_id, | ^~~~~~~~~~~~~~~~~~~ arch/loongarch/vdso/vgetcpu.c:27:5: warning: no previous prototype for '__vdso_getcpu' [-Wmissing-prototypes] 27 | int __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused) Reported-by: kernel test robot <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 7c12bb8 commit 84e7620

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

arch/loongarch/vdso/vgetcpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ static __always_inline const struct vdso_pcpu_data *get_pcpu_data(void)
2424
return (struct vdso_pcpu_data *)(get_vdso_base() - VDSO_DATA_SIZE);
2525
}
2626

27+
extern
28+
int __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused);
2729
int __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused)
2830
{
2931
int cpu_id;

arch/loongarch/vdso/vgettimeofday.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66
*/
77
#include <linux/types.h>
88

9-
int __vdso_clock_gettime(clockid_t clock,
10-
struct __kernel_timespec *ts)
9+
extern
10+
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
11+
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
1112
{
1213
return __cvdso_clock_gettime(clock, ts);
1314
}
1415

15-
int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
16-
struct timezone *tz)
16+
extern
17+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
18+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
1719
{
1820
return __cvdso_gettimeofday(tv, tz);
1921
}
2022

21-
int __vdso_clock_getres(clockid_t clock_id,
22-
struct __kernel_timespec *res)
23+
extern
24+
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
25+
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
2326
{
2427
return __cvdso_clock_getres(clock_id, res);
2528
}

0 commit comments

Comments
 (0)