aboutsummaryrefslogtreecommitdiff
path: root/arch/m32r/kernel/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-05 10:53:49 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-05 10:53:49 -0800
commit8fcf4e5a572af520580b14abd9017760e6fcdada (patch)
tree8d931ef0c484b6065ec942324e7bc891406b69cb /arch/m32r/kernel/time.c
parentbd901751e7ab9ddba335b19643605b3cf8517078 (diff)
parent45cdd473301aae36e1f10664b9fe7ef5aad3f182 (diff)
Merge branch 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev
* 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev: m32r: Should index be positive? m32r: bzip2/lzma kernel compression support m32r: add NOTES to vmlinux.lds.S to remove .note.gnu.build-id section arch/m32r: Use DIV_ROUND_CLOSEST
Diffstat (limited to 'arch/m32r/kernel/time.c')
-rw-r--r--arch/m32r/kernel/time.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index e7fee0f198d..9cedcef1157 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -75,7 +75,7 @@ u32 arch_gettimeoffset(void)
count = 0;
count = (latch - count) * TICK_SIZE;
- elapsed_time = (count + latch / 2) / latch;
+ elapsed_time = DIV_ROUND_CLOSEST(count, latch);
/* NOTE: LATCH is equal to the "interval" value (= reload count). */
#else /* CONFIG_SMP */
@@ -93,7 +93,7 @@ u32 arch_gettimeoffset(void)
p_count = count;
count = (latch - count) * TICK_SIZE;
- elapsed_time = (count + latch / 2) / latch;
+ elapsed_time = DIV_ROUND_CLOSEST(count, latch);
/* NOTE: LATCH is equal to the "interval" value (= reload count). */
#endif /* CONFIG_SMP */
#elif defined(CONFIG_CHIP_M32310)
@@ -211,7 +211,7 @@ void __init time_init(void)
bus_clock = boot_cpu_data.bus_clock;
divide = boot_cpu_data.timer_divide;
- latch = (bus_clock/divide + HZ / 2) / HZ;
+ latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ);
printk("Timer start : latch = %ld\n", latch);