aboutsummaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2014-12-08 13:19:12 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-12-08 14:03:43 +0100
commit351997810131565fe62aec2c366deccbf6bda3f4 (patch)
tree85f8346b5882b63f840a78d5beb8bd88a0eaeb13 /arch/s390
parent8622384f138b786b9ae639e79ccfb84c7db82cbc (diff)
s390/cputime: fix 31-bit compile
git commit 8461b63ca01d125a245a0d0fb4821ea0656e5053 "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>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/cputime.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index b81712306360..b91e960e4045 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -94,7 +94,7 @@ static inline cputime_t secs_to_cputime(const unsigned int s)
static inline cputime_t timespec_to_cputime(const struct timespec *value)
{
unsigned long long ret = value->tv_sec * CPUTIME_PER_SEC;
- return (__force cputime_t)(ret + (value->tv_nsec * CPUTIME_PER_USEC) / NSEC_PER_USEC);
+ return (__force cputime_t)(ret + __div(value->tv_nsec * CPUTIME_PER_USEC, NSEC_PER_USEC));
}
static inline void cputime_to_timespec(const cputime_t cputime,