tree 50c269e9ffae84079f4b4e7b3da85d47eef337e9
parent 42bfea6fd9eddd2036880d260d71106430618029
author Horms <[EMAIL PROTECTED]> Tue, 02 Aug 2005 16:16:51 +0900
committer Marcelo Tosatti <[EMAIL PROTECTED]> Sat, 06 Aug 2005 00:06:21 -0300

[PATCH] ppc32: stop misusing ntps time_offset value

v2.4 backport

Signed-off-by: Horms <[EMAIL PROTECTED]>

From: john stultz <[EMAIL PROTECTED]>
Date: Fri, 1 Jul 2005 05:08:54 +0000 (+1000)
Subject: [PATCH] ppc32: stop misusing ntps time_offset value
X-Git-Tag: v2.6.12.3
X-Git-Url: 
http://www.kernel.org/git/?p=linux/kernel/git/gregkh/linux-2.6.12.y.git;a=commitdiff;h=8f399a7448e0b58eae969426f61b7e81d55d2639

  [PATCH] ppc32: stop misusing ntps time_offset value

  As part of my timeofday rework, I've been looking at the NTP code and I
  noticed that the PPC architecture is apparently misusing the NTP's
  time_offset (it is a terrible name!) value as some form of timezone offset.

  This could cause problems when time_offset changed by the NTP code.  This
  patch changes the PPC code so it uses a more clear local variable:
  timezone_offset.

  Signed-off-by: John Stultz <[EMAIL PROTECTED]>
  Acked-by: Tom Rini <[EMAIL PROTECTED]>
  Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
  Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
  Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
  Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

 arch/ppc/kernel/time.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -84,7 +84,7 @@ unsigned tb_last_stamp;
 
 extern unsigned long wall_jiffies;
 
-static long time_offset;
+static long timezone_offset;
 
 spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
 
@@ -187,7 +187,7 @@ int timer_interrupt(struct pt_regs * reg
                     xtime.tv_sec - last_rtc_update >= 659 &&
                     abs(xtime.tv_usec - (1000000-1000000/HZ)) < 500000/HZ &&
                     jiffies - wall_jiffies == 1) {
-                       if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) 
== 0)
+                       if (ppc_md.set_rtc_time(xtime.tv_sec+1 + 
timezone_offset) == 0)
                                last_rtc_update = xtime.tv_sec+1;
                        else
                                /* Try again one minute later */
@@ -297,7 +297,7 @@ void __init time_init(void)
        unsigned old_stamp, stamp, elapsed;
 
         if (ppc_md.time_init != NULL)
-                time_offset = ppc_md.time_init();
+                timezone_offset = ppc_md.time_init();
 
        if (__USE_RTC()) {
                /* 601 processor: dec counts down by 128 every 128ns */
@@ -344,9 +344,9 @@ void __init time_init(void)
        /* If platform provided a timezone (pmac), we correct the time
         * using do_sys_settimeofday() which in turn calls warp_clock()
         */
-        if (time_offset) {
+        if (timezone_offset) {
                struct timezone tz;
-               tz.tz_minuteswest = -time_offset / 60;
+               tz.tz_minuteswest = -timezone_offset / 60;
                tz.tz_dsttime = 0;
                do_sys_settimeofday(NULL, &tz);
         }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-24" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to