linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions
@ 2020-09-15 11:24 Tian Tao
  2020-09-15 11:48 ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Tian Tao @ 2020-09-15 11:24 UTC (permalink / raw)
  To: catalin.marinas, will, vincenzo.frascino, tglx, linux-arm-kernel; +Cc: linuxarm

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,

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 arch/arm64/kernel/vdso/vgettimeofday.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/kernel/vdso/vgettimeofday.c b/arch/arm64/kernel/vdso/vgettimeofday.c
index 4236cf3..e808481 100644
--- a/arch/arm64/kernel/vdso/vgettimeofday.c
+++ b/arch/arm64/kernel/vdso/vgettimeofday.c
@@ -6,18 +6,27 @@
  *
  */
 
+extern
+int __kernel_clock_gettime(clockid_t clock,
+			   struct __kernel_timespec *ts);
 int __kernel_clock_gettime(clockid_t clock,
 			   struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
+extern
+int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
+			  struct timezone *tz);
 int __kernel_gettimeofday(struct __kernel_old_timeval *tv,
 			  struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
+extern
+int __kernel_clock_getres(clockid_t clock_id,
+			  struct __kernel_timespec *res);
 int __kernel_clock_getres(clockid_t clock_id,
 			  struct __kernel_timespec *res)
 {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions
  2020-09-15 11:24 [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions Tian Tao
@ 2020-09-15 11:48 ` Will Deacon
  2020-09-15 12:06   ` tiantao (H)
  2020-09-18 14:41   ` Jean-Philippe Brucker
  0 siblings, 2 replies; 4+ messages in thread
From: Will Deacon @ 2020-09-15 11:48 UTC (permalink / raw)
  To: Tian Tao
  Cc: catalin.marinas, tglx, vincenzo.frascino, linuxarm, linux-arm-kernel

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?

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions
  2020-09-15 11:48 ` Will Deacon
@ 2020-09-15 12:06   ` tiantao (H)
  2020-09-18 14:41   ` Jean-Philippe Brucker
  1 sibling, 0 replies; 4+ messages in thread
From: tiantao (H) @ 2020-09-15 12:06 UTC (permalink / raw)
  To: Will Deacon, Tian Tao
  Cc: catalin.marinas, tglx, vincenzo.frascino, linuxarm, linux-arm-kernel

riscv has fixed the warning by adding a declaration in the
kernel.
I agree with you.We should ignore this warning.

在 2020/9/15 19:48, Will Deacon 写道:
> 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?
> 
> Will
> 
> .
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions
  2020-09-15 11:48 ` Will Deacon
  2020-09-15 12:06   ` tiantao (H)
@ 2020-09-18 14:41   ` Jean-Philippe Brucker
  1 sibling, 0 replies; 4+ messages in thread
From: Jean-Philippe Brucker @ 2020-09-18 14:41 UTC (permalink / raw)
  To: Will Deacon
  Cc: catalin.marinas, linuxarm, Tian Tao, tglx, vincenzo.frascino,
	linux-arm-kernel

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-18 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 11:24 [PATCH] arm64: vdso: Add extern declarations for vDSO time-related functions Tian Tao
2020-09-15 11:48 ` Will Deacon
2020-09-15 12:06   ` tiantao (H)
2020-09-18 14:41   ` Jean-Philippe Brucker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).