linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/arm: Use constants instead of magic numbers in do_gettimeofday.
@ 2010-05-06  1:19 Corbin Simpson
  2010-05-06  1:22 ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Corbin Simpson @ 2010-05-06  1:19 UTC (permalink / raw)
  To: linux-arm-kernel

Part of the Didj patch.

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
---
 arch/arm/kernel/time.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 2875380..5cb4ff9 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -104,12 +104,12 @@ void do_gettimeofday(struct timeval *tv)
 		seq = read_seqbegin_irqsave(&xtime_lock, flags);
 		usec = system_timer->offset();
 		sec = xtime.tv_sec;
-		usec += xtime.tv_nsec / 1000;
+		usec += xtime.tv_nsec / NSEC_PER_USEC;
 	} while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
 
 	/* usec may have gone up a lot: be safe */
-	while (usec >= 1000000) {
-		usec -= 1000000;
+	while (usec >=  USEC_PER_SEC) {
+		usec -= USEC_PER_SEC;
 		sec++;
 	}
 
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-07 12:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06  1:19 [PATCH] arch/arm: Use constants instead of magic numbers in do_gettimeofday Corbin Simpson
2010-05-06  1:22 ` Ben Dooks
2010-05-07 12:01   ` Corbin Simpson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).