提交 877084fb 编写于 作者: A Akinobu Mita 提交者: Ingo Molnar

x86: cleanup div_sc() usage

Remove the magic number in the third argment of div_sc().
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 d454157b
...@@ -451,7 +451,8 @@ void __init setup_boot_APIC_clock(void) ...@@ -451,7 +451,8 @@ void __init setup_boot_APIC_clock(void)
} }
/* Calculate the scaled math multiplication factor */ /* Calculate the scaled math multiplication factor */
lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS, 32); lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS,
lapic_clockevent.shift);
lapic_clockevent.max_delta_ns = lapic_clockevent.max_delta_ns =
clockevent_delta2ns(0x7FFFFF, &lapic_clockevent); clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
lapic_clockevent.min_delta_ns = lapic_clockevent.min_delta_ns =
......
...@@ -360,7 +360,8 @@ static void __init calibrate_APIC_clock(void) ...@@ -360,7 +360,8 @@ static void __init calibrate_APIC_clock(void)
result / 1000 / 1000, result / 1000 % 1000); result / 1000 / 1000, result / 1000 % 1000);
/* Calculate the scaled math multiplication factor */ /* Calculate the scaled math multiplication factor */
lapic_clockevent.mult = div_sc(result, NSEC_PER_SEC, 32); lapic_clockevent.mult = div_sc(result, NSEC_PER_SEC,
lapic_clockevent.shift);
lapic_clockevent.max_delta_ns = lapic_clockevent.max_delta_ns =
clockevent_delta2ns(0x7FFFFF, &lapic_clockevent); clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
lapic_clockevent.min_delta_ns = lapic_clockevent.min_delta_ns =
......
...@@ -218,7 +218,7 @@ static void hpet_legacy_clockevent_register(void) ...@@ -218,7 +218,7 @@ static void hpet_legacy_clockevent_register(void)
hpet_freq = 1000000000000000ULL; hpet_freq = 1000000000000000ULL;
do_div(hpet_freq, hpet_period); do_div(hpet_freq, hpet_period);
hpet_clockevent.mult = div_sc((unsigned long) hpet_freq, hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
NSEC_PER_SEC, 32); NSEC_PER_SEC, hpet_clockevent.shift);
/* Calculate the min / max delta */ /* Calculate the min / max delta */
hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF, hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
&hpet_clockevent); &hpet_clockevent);
......
...@@ -115,7 +115,8 @@ void __init setup_pit_timer(void) ...@@ -115,7 +115,8 @@ void __init setup_pit_timer(void)
* IO_APIC has been initialized. * IO_APIC has been initialized.
*/ */
pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id()); pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32); pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
pit_clockevent.shift);
pit_clockevent.max_delta_ns = pit_clockevent.max_delta_ns =
clockevent_delta2ns(0x7FFF, &pit_clockevent); clockevent_delta2ns(0x7FFF, &pit_clockevent);
pit_clockevent.min_delta_ns = pit_clockevent.min_delta_ns =
......
...@@ -364,7 +364,8 @@ int __init mfgpt_timer_setup(void) ...@@ -364,7 +364,8 @@ int __init mfgpt_timer_setup(void)
geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val); geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
/* Set up the clock event */ /* Set up the clock event */
mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32); mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC,
mfgpt_clockevent.shift);
mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF, mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
&mfgpt_clockevent); &mfgpt_clockevent);
mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE, mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册