From: "Jan Beulich" Subject: [PATCH] linux/x86: fixup time-xen.c Date: Thu, 25 Oct 2007 10:49:47 +0100 Message-ID: <472082DB.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Jan Beulich Index: head-2007-10-15/arch/i386/kernel/time-xen.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-10-15.orig/arch/i386/kernel/time-xen.c 2007-10-22 = 11:08:24.000000000 +0200 +++ head-2007-10-15/arch/i386/kernel/time-xen.c 2007-10-22 11:10:29.0000000= 00 +0200 @@ -793,44 +793,15 @@ void notify_arch_cmos_timer(void) mod_timer(&sync_xen_wallclock_timer, jiffies + 1); } =20 -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 =3D -get_cmos_time(); - clock_cmos_diff +=3D get_seconds(); - sleep_start =3D 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 =3D get_cmos_time() + clock_cmos_diff; - sleep_length =3D (get_cmos_time() - sleep_start) * HZ; - write_seqlock_irqsave(&xtime_lock, flags); - xtime.tv_sec =3D sec; - xtime.tv_nsec =3D 0; - jiffies_64 +=3D sleep_length; - wall_jiffies +=3D sleep_length; - write_sequnlock_irqrestore(&xtime_lock, flags); - touch_softlockup_watchdog(); + extern void time_resume(void); + time_resume(); return 0; } =20 -void time_resume(void); static struct sysdev_class timer_sysclass =3D { - .resume =3D time_resume, + .resume =3D timer_resume, set_kset_name("timer"), }; =20 @@ -1060,7 +1031,7 @@ void local_teardown_timer(unsigned int c } #endif =20 -#if CONFIG_CPU_FREQ +#ifdef CONFIG_CPU_FREQ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long = val,=20 void *data) {