Re: [PATCH] clean up FIXME in do_timer_interrupt

Andrew Morton
2005-03-04T00:53:35Z

Lee Revell <rlrevell@joe-job.com> wrote:
>
> AFAICT this code is equivalent and cleans up the (efi_)set_rtc_mmss code
> referred to as "horrible... FIXME" in the comments. Completely
> untested.
>
> Signed-Off-By: Lee Revell <rlrevell@joe-job.com>
>
> --- linux-2.6.11-rc4/arch/i386/kernel/time.c.orig 2005-03-03 11:52:32.000000000 -0500
> +++ linux-2.6.11-rc4/arch/i386/kernel/time.c 2005-03-03 12:02:20.000000000 -0500
> @@ -254,16 +254,10 @@
> >= USEC_AFTER - ((unsigned) TICK_SIZE) / 2 &&
> (xtime.tv_nsec / 1000)
> <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2) {
> - /* horrible...FIXME */
> - if (efi_enabled) {
> - if (efi_set_rtc_mmss(xtime.tv_sec) == 0)
> - last_rtc_update = xtime.tv_sec;
> - else
> - last_rtc_update = xtime.tv_sec - 600;
> - } else if (set_rtc_mmss(xtime.tv_sec) == 0)
> - last_rtc_update = xtime.tv_sec;
> - else
> - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
> + last_rtc_update = xtime.tv_sec;
> + if (efi_enabled && efi_set_rtc_mmss(xtime.tv_sec) ||
> + set_rtc_mmss(xtime.tv_sec))
> + last_rtc_update -= 600;

It's not equivalent.

If efi_enabled is true and efi_set_rtc_mmss(xtime.tv_sec) returns zero, the
new code will run set_rtc_mmss(xtime.tv_sec) whereas the old code won't.