Skip to content

Commit 3519978

Browse files
author
Martin Schwidefsky
committed
s390/cputime: fix 31-bit compile
git commit 8461b63 "s390: translate cputime magic constants to macros" introduce a built error for 31-bit: kernel/built-in.o: In function `posix_cpu_timer_set': posix-cpu-timers.c:(.text+0x2a8cc): undefined reference to `__udivdi3' The original code is actually broken for 31-bit and has been corrected by the above commit by forcing the compiler to use 64-bit arithmetic through the CPUTIME_PER_USEC define. To fix the compile error replace the 64-bit division with a call to __div(). Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 8622384 commit 3519978

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/s390/include/asm/cputime.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline cputime_t secs_to_cputime(const unsigned int s)
9494
static inline cputime_t timespec_to_cputime(const struct timespec *value)
9595
{
9696
unsigned long long ret = value->tv_sec * CPUTIME_PER_SEC;
97-
return (__force cputime_t)(ret + (value->tv_nsec * CPUTIME_PER_USEC) / NSEC_PER_USEC);
97+
return (__force cputime_t)(ret + __div(value->tv_nsec * CPUTIME_PER_USEC, NSEC_PER_USEC));
9898
}
9999

100100
static inline void cputime_to_timespec(const cputime_t cputime,

0 commit comments

Comments
 (0)