]> git.itanic.dy.fi Git - linux-stable/commit
arm64: vdso32: Define BUILD_VDSO32_64 to correct prototypes
authorNathan Chancellor <nathan@kernel.org>
Tue, 28 Nov 2023 16:52:48 +0000 (09:52 -0700)
committerArnd Bergmann <arnd@arndb.de>
Tue, 28 Nov 2023 17:24:52 +0000 (18:24 +0100)
commit7192ad2adde8213ad7c7f3b1ff974cccebae4d60
tree814f635e2d92498cbe5d002390f415ea13462b3e
parentca8e45c8048a2c9503c74751d25414601f730580
arm64: vdso32: Define BUILD_VDSO32_64 to correct prototypes

After commit 42874e4eb35b ("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: 42874e4eb35b ("arch: vdso: consolidate gettime prototypes")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Closes: https://lore.kernel.org/CA+G9fYtV6X=c3JVTTAX89_=wc+uqLpzggnsbGSx-98m_5yd5yw@mail.gmail.com/
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/ZWCRWArzbTYUjvon@finisterre.sirena.org.uk/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm64/kernel/vdso32/vgettimeofday.c