diff options
Diffstat (limited to 'arch/sh/kernel/time.c')
-rw-r--r-- | arch/sh/kernel/time.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index f664a196c4f5..450c68f1df05 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <asm/timer.h> | 18 | #include <asm/timer.h> |
19 | #include <asm/kgdb.h> | 19 | #include <asm/kgdb.h> |
20 | 20 | ||
21 | extern unsigned long wall_jiffies; | ||
22 | struct sys_timer *sys_timer; | 21 | struct sys_timer *sys_timer; |
23 | 22 | ||
24 | /* Move this somewhere more sensible.. */ | 23 | /* Move this somewhere more sensible.. */ |
@@ -52,16 +51,10 @@ void do_gettimeofday(struct timeval *tv) | |||
52 | { | 51 | { |
53 | unsigned long seq; | 52 | unsigned long seq; |
54 | unsigned long usec, sec; | 53 | unsigned long usec, sec; |
55 | unsigned long lost; | ||
56 | 54 | ||
57 | do { | 55 | do { |
58 | seq = read_seqbegin(&xtime_lock); | 56 | seq = read_seqbegin(&xtime_lock); |
59 | usec = get_timer_offset(); | 57 | usec = get_timer_offset(); |
60 | |||
61 | lost = jiffies - wall_jiffies; | ||
62 | if (lost) | ||
63 | usec += lost * (1000000 / HZ); | ||
64 | |||
65 | sec = xtime.tv_sec; | 58 | sec = xtime.tv_sec; |
66 | usec += xtime.tv_nsec / 1000; | 59 | usec += xtime.tv_nsec / 1000; |
67 | } while (read_seqretry(&xtime_lock, seq)); | 60 | } while (read_seqretry(&xtime_lock, seq)); |
@@ -91,8 +84,7 @@ int do_settimeofday(struct timespec *tv) | |||
91 | * wall time. Discover what correction gettimeofday() would have | 84 | * wall time. Discover what correction gettimeofday() would have |
92 | * made, and then undo it! | 85 | * made, and then undo it! |
93 | */ | 86 | */ |
94 | nsec -= 1000 * (get_timer_offset() + | 87 | nsec -= 1000 * get_timer_offset(); |
95 | (jiffies - wall_jiffies) * (1000000 / HZ)); | ||
96 | 88 | ||
97 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | 89 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); |
98 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | 90 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); |