[PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions

Jean-Philippe Brucker jean-philippe at linaro.org
Fri Sep 18 10:41:28 EDT 2020


On Tue, Sep 15, 2020 at 12:48:02PM +0100, Will Deacon wrote:
> On Tue, Sep 15, 2020 at 07:24:30PM +0800, Tian Tao wrote:
> > Add extern declarations for vDSO time-related functions to notify the
> > compiler these functions will be used in somewhere to fix
> > "no previous prototype" compile warning.
> > 
> > arch/arm64/kernel/vdso/vgettimeofday.c:9:5: warning: no previous
> > prototype for ‘__kernel_clock_gettime’ [-Wmissing-prototypes]
> > int __kernel_clock_gettime(clockid_t clock,
> >      ^
> > arch/arm64/kernel/vdso/vgettimeofday.c:15:5: warning: no previous
> > prototype for ‘__kernel_gettimeofday’ [-Wmissing-prototypes]
> > int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
> >      ^
> > arch/arm64/kernel/vdso/vgettimeofday.c:21:5: warning: no previous
> > prototype for ‘__kernel_clock_getres’ [-Wmissing-prototypes]
> > int __kernel_clock_getres(clockid_t clock_id,
> 
> I think this warning is silly and we should ignore it. The function is
> only called from userspace, so why should we add a declaration in the
> kernel?

I was about to send the same patch - the warning is pretty distracting
since the VDSO is rebuilt frequently, and it's thrown both by GCC with W=1
and by sparse with C=1.

Thanks,
Jean



More information about the linux-arm-kernel mailing list