]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
S390: __div64_31 broken for CONFIG_MARCH_G5
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 18 Mar 2009 12:27:32 +0000 (13:27 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 23 Mar 2009 21:55:24 +0000 (14:55 -0700)
commitcd0af9303b6953350278cbc650ad8173e8c0dc58
tree319a845f12d71873a609306f0053c63507df75af
parent85cf549f789682191f527408f028a5d7dd125bfc
S390: __div64_31 broken for CONFIG_MARCH_G5

commit 4fa81ed27781a12f6303b9263056635ae74e3e21 upstream.

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.

Reported-by: Frans Pop <elendil@planet.nl>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/s390/lib/div64.c