From b87a43274994bfe4cbc0ce91ac88e251a96899bc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 11 Nov 2009 14:05:34 +0000 Subject: [PATCH] --- yaml --- r: 173135 b: refs/heads/master c: e3a4fab0c0c30e21e104712f4e9cb39f175d0f21 h: refs/heads/master i: 173133: d71c7b47be5338c3d5c8fec809cdbcf48f501847 173131: aebbb71c93f61a39cf991d4c089c7364829f5685 173127: a4b65d3b23141228521430e23fba283a161bf2fa 173119: ec6fb4df3bc08e11b7f4285500b0886d14f644b7 v: v3 --- [refs] | 2 +- trunk/arch/mips/include/asm/time.h | 14 ++++++++++--- trunk/arch/mips/kernel/time.c | 33 ------------------------------ 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/[refs] b/[refs] index 445278a45908..e447dcf9214a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7d2f944a2b836c69a9d260a0a5f0d1720d57fdff +refs/heads/master: e3a4fab0c0c30e21e104712f4e9cb39f175d0f21 diff --git a/trunk/arch/mips/include/asm/time.h b/trunk/arch/mips/include/asm/time.h index df6a430de5eb..c7f1bfef1574 100644 --- a/trunk/arch/mips/include/asm/time.h +++ b/trunk/arch/mips/include/asm/time.h @@ -84,8 +84,16 @@ static inline int init_mips_clocksource(void) #endif } -extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); -extern void clockevent_set_clock(struct clock_event_device *cd, - unsigned int clock); +static inline void clocksource_set_clock(struct clocksource *cs, + unsigned int clock) +{ + clocksource_calc_mult_shift(cs, clock, 4); +} + +static inline void clockevent_set_clock(struct clock_event_device *cd, + unsigned int clock) +{ + clockevents_calc_mult_shift(cd, clock, 4); +} #endif /* _ASM_TIME_H */ diff --git a/trunk/arch/mips/kernel/time.c b/trunk/arch/mips/kernel/time.c index 1f467d534642..fb7497405510 100644 --- a/trunk/arch/mips/kernel/time.c +++ b/trunk/arch/mips/kernel/time.c @@ -71,39 +71,6 @@ EXPORT_SYMBOL(perf_irq); unsigned int mips_hpt_frequency; -void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock) -{ - u64 temp; - u32 shift; - - /* Find a shift value */ - for (shift = 32; shift > 0; shift--) { - temp = (u64) NSEC_PER_SEC << shift; - do_div(temp, clock); - if ((temp >> 32) == 0) - break; - } - cs->shift = shift; - cs->mult = (u32) temp; -} - -void __cpuinit clockevent_set_clock(struct clock_event_device *cd, - unsigned int clock) -{ - u64 temp; - u32 shift; - - /* Find a shift value */ - for (shift = 32; shift > 0; shift--) { - temp = (u64) clock << shift; - do_div(temp, NSEC_PER_SEC); - if ((temp >> 32) == 0) - break; - } - cd->shift = shift; - cd->mult = (u32) temp; -} - /* * This function exists in order to cause an error due to a duplicate * definition if platform code should have its own implementation. The hook