Skip to content

Commit

Permalink
cris: move usec/nsec conversion to do_slow_gettimeoffset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Warren committed Dec 24, 2012
1 parent a49f0d1 commit 547046f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions arch/cris/arch-v10/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 547046f

Please sign in to comment.