[PATCH 1/4] vdso: ARM: fix building without ARM_ARCH_TIMER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the arch timer is disabled, the vdso fails to build:

In file included from lib/vdso/gettimeofday.c:26,
                 from <command-line>:
arch/arm/include/asm/vdso/gettimeofday.h: In function '__arch_get_hw_counter':
arch/arm/include/asm/vdso/gettimeofday.h:72:9: error: implicit declaration of function 'arch_counter_get_cntvct'; did you mean 'arch_timer_get_rate'? [-Werror=implicit-function-declaration]
  return arch_counter_get_cntvct();
         ^~~~~~~~~~~~~~~~~~~~~~~

Make it use the fallback path instead by returning a negative
error code here.

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
 arch/arm/include/asm/vdso/gettimeofday.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/vdso/gettimeofday.h b/arch/arm/include/asm/vdso/gettimeofday.h
index 112df50920b0..77ace4a757c1 100644
--- a/arch/arm/include/asm/vdso/gettimeofday.h
+++ b/arch/arm/include/asm/vdso/gettimeofday.h
@@ -69,7 +69,11 @@ static __always_inline notrace int clock_getres_fallback(
 
 static __always_inline notrace u64 __arch_get_hw_counter(int clock_mode)
 {
+#ifdef CONFIG_ARM_ARCH_TIMER
 	return arch_counter_get_cntvct();
+#else
+	return -EINVAL; /* use fallback */
+#endif
 }
 
 static __always_inline notrace const struct vdso_data *__arch_get_vdso_data(void)
-- 
2.20.0




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux