Skip to contentSkip to conversation

linux/x86: fixup time-xen.c

PATCH New Jan Beulich 1 participant 1 message Oct 25, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/x86: fixup time-xen.c

Changeset 143 removed the uses of timer_suspend/timer_resume, but not the implementations. It also introduced an incompatible pointer assignment.

Also replace an #if checking a CONFIG_ variable by #ifdef.

As usual, written and tested against 2.6.23 and made apply against 2.6.18 without further testing.

arch/i386/kernel/time-xen.c +4 -33
Index: head-2007-10-15/arch/i386/kernel/time-xen.c
===================================================================
@@ -793,44 +793,15 @@ void notify_arch_cmos_timer(void)
 	mod_timer(&sync_xen_wallclock_timer, jiffies + 1);
 }
 
-static long clock_cmos_diff, sleep_start;
-
-static int timer_suspend(struct sys_device *dev, pm_message_t state)
-{
-	/*
-	 * Estimate time zone so that set_time can update the clock
-	 */
-	clock_cmos_diff = -get_cmos_time();
-	clock_cmos_diff += get_seconds();
-	sleep_start = get_cmos_time();
-	return 0;
-}
-
 static int timer_resume(struct sys_device *dev)
 {
-	unsigned long flags;
-	unsigned long sec;
-	unsigned long sleep_length;
-
-#ifdef CONFIG_HPET_TIMER
-	if (is_hpet_enabled())
-		hpet_reenable();
-#endif
-	sec = get_cmos_time() + clock_cmos_diff;
-	sleep_length = (get_cmos_time() - sleep_start) * HZ;
-	write_seqlock_irqsave(&xtime_lock, flags);
-	xtime.tv_sec = sec;
-	xtime.tv_nsec = 0;
-	jiffies_64 += sleep_length;
-	wall_jiffies += sleep_length;
-	write_sequnlock_irqrestore(&xtime_lock, flags);
-	touch_softlockup_watchdog();
+	extern void time_resume(void);
+	time_resume();
 	return 0;
 }
 
-void time_resume(void);
 static struct sysdev_class timer_sysclass = {
-	.resume = time_resume,
+	.resume = timer_resume,
 	set_kset_name("timer"),
 };
 
@@ -1060,7 +1031,7 @@ void local_teardown_timer(unsigned int c
 }
 #endif
 
-#if CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ
 static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 
 				void *data)
 {