aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/lib/div64.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2009-03-18 08:27:32 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-03-18 08:28:12 -0400
commit4fa81ed27781a12f6303b9263056635ae74e3e21 (patch)
treefab8df760ab6a01b9051c67b914c6e6b208607ba /arch/s390/lib/div64.c
parentee568b25ee9e160b32d1aef73d8b2ee9c05d34db (diff)
[S390] __div64_31 broken for CONFIG_MARCH_G5
The implementation of __div64_31 for G5 machines is broken. The comments in __div64_31 are correct, only the code does not do what the comments say. The part "If the remainder has overflown subtract base and increase the quotient" is only partially realized, the base is subtracted correctly but the quotient is only increased if the dividend had the last bit set. Using the correct instruction fixes the problem. Cc: stable@kernel.org Reported-by: Frans Pop <elendil@planet.nl> Tested-by: Frans Pop <elendil@planet.nl> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/lib/div64.c')
-rw-r--r--arch/s390/lib/div64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/lib/div64.c b/arch/s390/lib/div64.c
index a5f8300bf3ee..d9e62c0b576a 100644
--- a/arch/s390/lib/div64.c
+++ b/arch/s390/lib/div64.c
@@ -61,7 +61,7 @@ static uint32_t __div64_31(uint64_t *n, uint32_t base)
61 " clr %0,%3\n" 61 " clr %0,%3\n"
62 " jl 0f\n" 62 " jl 0f\n"
63 " slr %0,%3\n" 63 " slr %0,%3\n"
64 " alr %1,%2\n" 64 " ahi %1,1\n"
65 "0:\n" 65 "0:\n"
66 : "+d" (reg2), "+d" (reg3), "=d" (tmp) 66 : "+d" (reg2), "+d" (reg3), "=d" (tmp)
67 : "d" (base), "2" (1UL) : "cc" ); 67 : "d" (base), "2" (1UL) : "cc" );