]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: cleanup div_sc() usage
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 19 Apr 2008 14:55:16 +0000 (23:55 +0900)
committerIngo Molnar <mingo@elte.hu>
Sat, 26 Apr 2008 15:35:47 +0000 (17:35 +0200)
Remove the magic number in the third argment of div_sc().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic_32.c
arch/x86/kernel/apic_64.c
arch/x86/kernel/hpet.c
arch/x86/kernel/i8253.c
arch/x86/kernel/mfgpt_32.c

index 8317401170b86845d3346251c3d44ef150830c05..4b99b1bdeb6cbb090e5868138922b259da7d98fe 100644 (file)
@@ -451,7 +451,8 @@ void __init setup_boot_APIC_clock(void)
        }
 
        /* 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 =
                clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
        lapic_clockevent.min_delta_ns =
index bf83157337e428bb84619478420d540e01fce466..5910020c3f24f20f4a1be57650d1e2d9c9a3a1fa 100644 (file)
@@ -360,7 +360,8 @@ static void __init calibrate_APIC_clock(void)
                result / 1000 / 1000, result / 1000 % 1000);
 
        /* 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 =
                clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
        lapic_clockevent.min_delta_ns =
index 36652ea1a2658d10d729647e0f613c01ccc88ee6..9007f9ea64eed80e9537be44d391fe55d6f7f749 100644 (file)
@@ -218,7 +218,7 @@ static void hpet_legacy_clockevent_register(void)
        hpet_freq = 1000000000000000ULL;
        do_div(hpet_freq, hpet_period);
        hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
-                                     NSEC_PER_SEC, 32);
+                                     NSEC_PER_SEC, hpet_clockevent.shift);
        /* Calculate the min / max delta */
        hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
                                                           &hpet_clockevent);
index e325cfe06401f61c1772b686705b762cdb6370d1..c1b5e3ece1f241f9ef8716abd02d98ad6721ffa7 100644 (file)
@@ -115,7 +115,8 @@ void __init setup_pit_timer(void)
         * IO_APIC has been initialized.
         */
        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 =
                clockevent_delta2ns(0x7FFF, &pit_clockevent);
        pit_clockevent.min_delta_ns =
index b402c0f3f192213f84595197f067c28043545ea1..cfc2648d25ff924e704b9316286f5cca1bae3049 100644 (file)
@@ -364,7 +364,8 @@ int __init mfgpt_timer_setup(void)
        geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
 
        /* 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);
        mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE,