[PATCH] ppc64: Fix typo in time calculations

Paul Mackerras paulus at samba.org
Fri Oct 21 22:39:36 EST 2005


This fixes a typo in the div128_by_32 function used in the timekeeping
calculations on ppc64.  If you look at the code it's quite obvious
that we need (rb + c) rather than (rb + b).  The "b" is clearly just a
typo.

Signed-off-by: Paul Mackerras <paulus at samba.org>
---
Linus, I think this should go in for 2.6.14, since it's very simple
and obvious.  However, the bug has been there forever and presumably
only has a very minor impact, so if you want to defer it, that's OK.

diff -urN linux-2.6/arch/ppc64/kernel/time.c test/arch/ppc64/kernel/time.c
--- linux-2.6/arch/ppc64/kernel/time.c	2005-09-08 15:22:59.000000000 +1000
+++ test/arch/ppc64/kernel/time.c	2005-10-21 22:00:44.000000000 +1000
@@ -870,7 +870,7 @@
 	rb = ((ra + b) - (x * divisor)) << 32;
 
 	y = (rb + c)/divisor;
-	rc = ((rb + b) - (y * divisor)) << 32;
+	rc = ((rb + c) - (y * divisor)) << 32;
 
 	z = (rc + d)/divisor;
 



More information about the Linuxppc64-dev mailing list