提交 0b91317e 编写于 作者: A Andi Kleen 提交者: Linus Torvalds

[PATCH] x86_64: Fix up white space in time.c

No functional changes.

And remove one redundant prototype.
Signed-off-by: NAndi Kleen <ak@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 2c8bc944
...@@ -251,8 +251,8 @@ static void set_rtc_mmss(unsigned long nowtime) ...@@ -251,8 +251,8 @@ static void set_rtc_mmss(unsigned long nowtime)
#endif #endif
{ {
BIN_TO_BCD(real_seconds); BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes); BIN_TO_BCD(real_minutes);
CMOS_WRITE(real_seconds, RTC_SECONDS); CMOS_WRITE(real_seconds, RTC_SECONDS);
CMOS_WRITE(real_minutes, RTC_MINUTES); CMOS_WRITE(real_minutes, RTC_MINUTES);
} }
...@@ -289,12 +289,11 @@ unsigned long long monotonic_clock(void) ...@@ -289,12 +289,11 @@ unsigned long long monotonic_clock(void)
last_offset = vxtime.last; last_offset = vxtime.last;
base = monotonic_base; base = monotonic_base;
this_offset = hpet_readl(HPET_COUNTER); this_offset = hpet_readl(HPET_COUNTER);
} while (read_seqretry(&xtime_lock, seq)); } while (read_seqretry(&xtime_lock, seq));
offset = (this_offset - last_offset); offset = (this_offset - last_offset);
offset *=(NSEC_PER_SEC/HZ)/hpet_tick; offset *=(NSEC_PER_SEC/HZ)/hpet_tick;
return base + offset; return base + offset;
}else{ } else {
do { do {
seq = read_seqbegin(&xtime_lock); seq = read_seqbegin(&xtime_lock);
...@@ -305,8 +304,6 @@ unsigned long long monotonic_clock(void) ...@@ -305,8 +304,6 @@ unsigned long long monotonic_clock(void)
offset = (this_offset - last_offset)*1000/cpu_khz; offset = (this_offset - last_offset)*1000/cpu_khz;
return base + offset; return base + offset;
} }
} }
EXPORT_SYMBOL(monotonic_clock); EXPORT_SYMBOL(monotonic_clock);
...@@ -530,36 +527,35 @@ unsigned long get_cmos_time(void) ...@@ -530,36 +527,35 @@ unsigned long get_cmos_time(void)
timeout--; timeout--;
} }
/* /*
* Here we are safe to assume the registers won't change for a whole second, so * Here we are safe to assume the registers won't change for a whole
* we just go ahead and read them. * second, so we just go ahead and read them.
*/ */
sec = CMOS_READ(RTC_SECONDS);
sec = CMOS_READ(RTC_SECONDS); min = CMOS_READ(RTC_MINUTES);
min = CMOS_READ(RTC_MINUTES); hour = CMOS_READ(RTC_HOURS);
hour = CMOS_READ(RTC_HOURS); day = CMOS_READ(RTC_DAY_OF_MONTH);
day = CMOS_READ(RTC_DAY_OF_MONTH); mon = CMOS_READ(RTC_MONTH);
mon = CMOS_READ(RTC_MONTH); year = CMOS_READ(RTC_YEAR);
year = CMOS_READ(RTC_YEAR);
spin_unlock_irqrestore(&rtc_lock, flags); spin_unlock_irqrestore(&rtc_lock, flags);
/* /*
* We know that x86-64 always uses BCD format, no need to check the config * We know that x86-64 always uses BCD format, no need to check the
* register. * config register.
*/ */
BCD_TO_BIN(sec); BCD_TO_BIN(sec);
BCD_TO_BIN(min); BCD_TO_BIN(min);
BCD_TO_BIN(hour); BCD_TO_BIN(hour);
BCD_TO_BIN(day); BCD_TO_BIN(day);
BCD_TO_BIN(mon); BCD_TO_BIN(mon);
BCD_TO_BIN(year); BCD_TO_BIN(year);
/* /*
* x86-64 systems only exists since 2002. * x86-64 systems only exists since 2002.
* This will work up to Dec 31, 2100 * This will work up to Dec 31, 2100
*/ */
year += 2000; year += 2000;
return mktime(year, mon, day, hour, min, sec); return mktime(year, mon, day, hour, min, sec);
...@@ -737,7 +733,7 @@ static __init int late_hpet_init(void) ...@@ -737,7 +733,7 @@ static __init int late_hpet_init(void)
unsigned int ntimer; unsigned int ntimer;
if (!vxtime.hpet_address) if (!vxtime.hpet_address)
return -1; return -1;
memset(&hd, 0, sizeof (hd)); memset(&hd, 0, sizeof (hd));
...@@ -871,8 +867,6 @@ static struct irqaction irq0 = { ...@@ -871,8 +867,6 @@ static struct irqaction irq0 = {
timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL
}; };
extern void __init config_acpi_tables(void);
void __init time_init(void) void __init time_init(void)
{ {
char *timename; char *timename;
...@@ -992,6 +986,10 @@ __setup("report_lost_ticks", time_setup); ...@@ -992,6 +986,10 @@ __setup("report_lost_ticks", time_setup);
static long clock_cmos_diff; static long clock_cmos_diff;
static unsigned long sleep_start; static unsigned long sleep_start;
/*
* sysfs support for the timer.
*/
static int timer_suspend(struct sys_device *dev, pm_message_t state) static int timer_suspend(struct sys_device *dev, pm_message_t state)
{ {
/* /*
...@@ -1034,7 +1032,6 @@ static struct sysdev_class timer_sysclass = { ...@@ -1034,7 +1032,6 @@ static struct sysdev_class timer_sysclass = {
set_kset_name("timer"), set_kset_name("timer"),
}; };
/* XXX this driverfs stuff should probably go elsewhere later -john */ /* XXX this driverfs stuff should probably go elsewhere later -john */
static struct sys_device device_timer = { static struct sys_device device_timer = {
.id = 0, .id = 0,
...@@ -1276,8 +1273,6 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1276,8 +1273,6 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
#endif #endif
static int __init nohpet_setup(char *s) static int __init nohpet_setup(char *s)
{ {
nohpet = 1; nohpet = 1;
...@@ -1294,5 +1289,3 @@ static int __init notsc_setup(char *s) ...@@ -1294,5 +1289,3 @@ static int __init notsc_setup(char *s)
} }
__setup("notsc", notsc_setup); __setup("notsc", notsc_setup);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册