cris: move usec/nsec conversion to do_slow_gettimeoffset
authorStephen Warren <swarren@nvidia.com>
Thu, 8 Nov 2012 17:50:55 +0000 (10:50 -0700)
committerStephen Warren <swarren@nvidia.com>
Mon, 24 Dec 2012 16:18:32 +0000 (09:18 -0700)
Move usec to nsec conversion from arch_gettimeoffset() to
do_slow_gettimeoffset(); in a future patch, do_slow_gettimeoffset()
will be used directly as the implementation of arch_gettimeoffset(),
so needs to perform all required calculations.

Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/cris/arch-v10/kernel/time.c
arch/cris/kernel/time.c

index bcffcb6a9415dc7cc991330e949465891a99c1d9..162892f24a208ea974fd7f196e2d9e6bb3eb9889 100644 (file)
@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void)
         */
        count = *R_TIMER0_DATA;
 
-       /* Convert timer value to usec */
-       return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV;
+       /* Convert timer value to nsec */
+       return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV;
 }
 
 /* Excerpt from the Etrax100 HSDD about the built-in watchdog:
index 277ffc459e4b821e8360e1042df6bff469f12057..b063c9217b5c64568167b4295a21857b1704dae9 100644 (file)
@@ -46,7 +46,7 @@ static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
 
 u32 arch_gettimeoffset(void)
 {
-       return do_gettimeoffset() * 1000;
+       return do_gettimeoffset();
 }
 #endif