From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756744AbZCNPMR (ORCPT ); Sat, 14 Mar 2009 11:12:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751472AbZCNPMA (ORCPT ); Sat, 14 Mar 2009 11:12:00 -0400 Received: from hera.kernel.org ([140.211.167.34]:41083 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751170AbZCNPMA (ORCPT ); Sat, 14 Mar 2009 11:12:00 -0400 Subject: [PATCH -tip] x86: i8253 cleanup From: Jaswinder Singh Rajput To: Ingo Molnar , x86 maintainers , LKML Content-Type: text/plain Date: Sat, 14 Mar 2009 20:41:33 +0530 Message-Id: <1237043493.4546.16.camel@ht.satnam> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 (2.24.5-1.fc10) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Subject: [PATCH] x86: i8253 cleanup Impact: cleanup - fix various style problems - fix header file issues Signed-off-by: Jaswinder Singh Rajput --- arch/x86/kernel/i8253.c | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c index 10f92fb..8613ee2 100644 --- a/arch/x86/kernel/i8253.c +++ b/arch/x86/kernel/i8253.c @@ -3,26 +3,26 @@ * */ #include -#include #include +#include #include #include -#include +#include +#include +#include -#include -#include #include -#include #include +#include DEFINE_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); #ifdef CONFIG_X86_32 static void pit_disable_clocksource(void); -#else +#else /* CONFIG_X86_32 */ static inline void pit_disable_clocksource(void) { } -#endif +#endif /* CONFIG_X86_32 */ /* * HPET replaces the PIT, when enabled. So we need to know, which of @@ -40,7 +40,7 @@ static void init_pit_timer(enum clock_event_mode mode, { spin_lock(&i8253_lock); - switch(mode) { + switch (mode) { case CLOCK_EVT_MODE_PERIODIC: /* binary, mode 2, LSB/MSB, ch 0 */ outb_pit(0x34, PIT_MODE); @@ -133,11 +133,11 @@ void __init setup_pit_timer(void) */ static cycle_t pit_read(void) { + static int old_count; unsigned long flags; + static u32 old_jifs; int count; u32 jifs; - static int old_count; - static u32 old_jifs; spin_lock_irqsave(&i8253_lock, flags); /* @@ -179,9 +179,9 @@ static cycle_t pit_read(void) * Previous attempts to handle these cases intelligently were * buggy, so we just do the simple thing now. */ - if (count > old_count && jifs == old_jifs) { + if (count > old_count && jifs == old_jifs) count = old_count; - } + old_count = count; old_jifs = jifs; @@ -227,6 +227,7 @@ static int __init init_pit_clocksource(void) clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_pit.shift); + return clocksource_register(&clocksource_pit); } arch_initcall(init_pit_clocksource); -- 1.6.0.6