• Nathan Chancellor's avatar
    arm64: vdso32: Define BUILD_VDSO32_64 to correct prototypes · 7192ad2a
    Nathan Chancellor authored
    After commit 42874e4e ("arch: vdso: consolidate gettime
    prototypes"), there are a couple of errors when building the 32-bit
    compat vDSO for arm64:
    
      arch/arm64/kernel/vdso32/vgettimeofday.c:10:5: error: conflicting types for '__vdso_clock_gettime'; have 'int(clockid_t,  struct old_timespec32 *)' {aka 'int(int,  struct old_timespec32 *)'}
         10 | int __vdso_clock_gettime(clockid_t clock,
            |     ^~~~~~~~~~~~~~~~~~~~
      In file included from arch/arm64/kernel/vdso32/vgettimeofday.c:8:
      include/vdso/gettime.h:16:5: note: previous declaration of '__vdso_clock_gettime' with type 'int(clockid_t,  struct __kernel_timespec *)' {aka 'int(int,  struct __kernel_timespec *)'}
         16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
            |     ^~~~~~~~~~~~~~~~~~~~
      arch/arm64/kernel/vdso32/vgettimeofday.c:28:5: error: conflicting types for '__vdso_clock_getres'; have 'int(clockid_t,  struct old_timespec32 *)' {aka 'int(int,  struct old_timespec32 *)'}
         28 | int __vdso_clock_getres(clockid_t clock_id,
            |     ^~~~~~~~~~~~~~~~~~~
      include/vdso/gettime.h:15:5: note: previous declaration of '__vdso_clock_getres' with type 'int(clockid_t,  struct __kernel_timespec *)' {aka 'int(int,  struct __kernel_timespec *)'}
         15 | int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
            |     ^~~~~~~~~~~~~~~~~~~
    
    The type of the second parameter in __vdso_clock_getres() and
    __vdso_clock_gettime() changes based on whether compiling for 32-bit vs.
    64-bit, which is controlled by CONFIG_64BIT or the preprocessor macro
    BUILD_VDSO32_64, which denotes a 32-bit vDSO is being built for a 64-bit
    architecture. Since this situation is the latter case, define
    BUILD_VDSO32_64 before the inclusion of include/vdso/gettime.h to clear
    up the warning
    
    Fixes: 42874e4e ("arch: vdso: consolidate gettime prototypes")
    Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
    Closes: https://lore.kernel.org/CA+G9fYtV6X=c3JVTTAX89_=wc+uqLpzggnsbGSx-98m_5yd5yw@mail.gmail.com/Reported-by: default avatarMark Brown <broonie@kernel.org>
    Closes: https://lore.kernel.org/ZWCRWArzbTYUjvon@finisterre.sirena.org.uk/Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    7192ad2a
vgettimeofday.c 878 Bytes