From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [patch 06/10] x86: cleanup div_sc() usage
Date: Sat, 19 Apr 2008 23:55:16 +0900 [thread overview]
Message-ID: <480a0a92.12da600a.609c.2994@mx.google.com> (raw)
In-Reply-To: <20080419145510.150338641@gmail.com>
[-- Attachment #1: x86-clock-event-div-sc-cleanup.patch --]
[-- Type: text/plain, Size: 3452 bytes --]
Remove the magic number in the third argment of div_sc().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/x86/kernel/apic_32.c | 3 ++-
arch/x86/kernel/apic_64.c | 3 ++-
arch/x86/kernel/hpet.c | 2 +-
arch/x86/kernel/i8253.c | 3 ++-
arch/x86/kernel/mfgpt_32.c | 3 ++-
5 files changed, 9 insertions(+), 5 deletions(-)
Index: 2.6-git/arch/x86/kernel/apic_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/apic_32.c
+++ 2.6-git/arch/x86/kernel/apic_32.c
@@ -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: 2.6-git/arch/x86/kernel/apic_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/apic_64.c
+++ 2.6-git/arch/x86/kernel/apic_64.c
@@ -360,7 +360,8 @@ static void __init calibrate_APIC_clock(
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: 2.6-git/arch/x86/kernel/hpet.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/hpet.c
+++ 2.6-git/arch/x86/kernel/hpet.c
@@ -218,7 +218,7 @@ static void hpet_legacy_clockevent_regis
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: 2.6-git/arch/x86/kernel/i8253.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/i8253.c
+++ 2.6-git/arch/x86/kernel/i8253.c
@@ -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: 2.6-git/arch/x86/kernel/mfgpt_32.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/mfgpt_32.c
+++ 2.6-git/arch/x86/kernel/mfgpt_32.c
@@ -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,
--
next prev parent reply other threads:[~2008-04-19 15:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080419145510.150338641@gmail.com>
2008-04-19 14:55 ` [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating Akinobu Mita
2008-04-19 14:55 ` [patch 02/10] x86: use MP_intsrc_info() Akinobu Mita
2008-04-19 14:55 ` [patch 03/10] x86: use bitmap library for pin_programmed Akinobu Mita
2008-04-19 14:55 ` [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem() Akinobu Mita
2008-04-19 14:55 ` [patch 05/10] x86: cleanup clocksource_hz2mult usage Akinobu Mita
2008-04-19 14:55 ` Akinobu Mita [this message]
2008-04-19 14:55 ` [patch 07/10] x86: use cpumask function for present, possible, and online cpus Akinobu Mita
2008-04-19 14:55 ` [patch 08/10] x86: get_bios_ebda() requires asm/io.h Akinobu Mita
2008-04-19 14:55 ` [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h Akinobu Mita
2008-04-19 14:55 ` [patch 10/10] x86: use get_bios_ebda() Akinobu Mita
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=480a0a92.12da600a.609c.2994@mx.google.com \
--to=akinobu.mita@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome