diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:05:00 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 18:01:48 -0400 |
commit | 47da70d32535000ec29cc206cfc1d318fbd8761f (patch) | |
tree | 075a580c4459e9a91843d7030942a77ae1ac1f1f | |
parent | 02cba1598a2a3b689e79ad6dad2532521f638271 (diff) |
timekeeping: Remove timekeeper.total_sleep_time
No more users. Remove it
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | include/linux/timekeeper_internal.h | 6 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 14 |
2 files changed, 5 insertions, 15 deletions
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index 87e0992564f2..8e5d77a01787 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h | |||
@@ -20,8 +20,8 @@ | |||
20 | * the tv_nsec part positive so we can use the usual normalization. | 20 | * the tv_nsec part positive so we can use the usual normalization. |
21 | * | 21 | * |
22 | * wall_to_monotonic is moved after resume from suspend for the | 22 | * wall_to_monotonic is moved after resume from suspend for the |
23 | * monotonic time not to jump. We need to add total_sleep_time to | 23 | * monotonic time not to jump. To calculate the real boot time offset |
24 | * wall_to_monotonic to get the real boot based time offset. | 24 | * we need to do offs_real - offs_boot. |
25 | * | 25 | * |
26 | * - wall_to_monotonic is no longer the boot time, getboottime must be | 26 | * - wall_to_monotonic is no longer the boot time, getboottime must be |
27 | * used instead. | 27 | * used instead. |
@@ -51,8 +51,6 @@ struct timekeeper { | |||
51 | /* Offset clock monotonic -> clock tai */ | 51 | /* Offset clock monotonic -> clock tai */ |
52 | ktime_t offs_tai; | 52 | ktime_t offs_tai; |
53 | 53 | ||
54 | /* time spent in suspend */ | ||
55 | struct timespec64 total_sleep_time; | ||
56 | /* The current UTC to TAI offset in seconds */ | 54 | /* The current UTC to TAI offset in seconds */ |
57 | s32 tai_offset; | 55 | s32 tai_offset; |
58 | 56 | ||
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 3edc0c1d6fe8..50d5de05b837 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -97,13 +97,9 @@ static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm) | |||
97 | tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); | 97 | tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void tk_set_sleep_time(struct timekeeper *tk, struct timespec64 t) | 100 | static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta) |
101 | { | 101 | { |
102 | /* Verify consistency before modifying */ | 102 | tk->offs_boot = ktime_add(tk->offs_boot, delta); |
103 | WARN_ON_ONCE(tk->offs_boot.tv64 != timespec64_to_ktime(tk->total_sleep_time).tv64); | ||
104 | |||
105 | tk->total_sleep_time = t; | ||
106 | tk->offs_boot = timespec64_to_ktime(t); | ||
107 | } | 103 | } |
108 | 104 | ||
109 | /** | 105 | /** |
@@ -919,10 +915,6 @@ void __init timekeeping_init(void) | |||
919 | set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); | 915 | set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); |
920 | tk_set_wall_to_mono(tk, tmp); | 916 | tk_set_wall_to_mono(tk, tmp); |
921 | 917 | ||
922 | tmp.tv_sec = 0; | ||
923 | tmp.tv_nsec = 0; | ||
924 | tk_set_sleep_time(tk, tmp); | ||
925 | |||
926 | timekeeping_update(tk, TK_MIRROR); | 918 | timekeeping_update(tk, TK_MIRROR); |
927 | 919 | ||
928 | write_seqcount_end(&tk_core.seq); | 920 | write_seqcount_end(&tk_core.seq); |
@@ -950,7 +942,7 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, | |||
950 | } | 942 | } |
951 | tk_xtime_add(tk, delta); | 943 | tk_xtime_add(tk, delta); |
952 | tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta)); | 944 | tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta)); |
953 | tk_set_sleep_time(tk, timespec64_add(tk->total_sleep_time, *delta)); | 945 | tk_update_sleep_time(tk, timespec64_to_ktime(*delta)); |
954 | tk_debug_account_sleep_time(delta); | 946 | tk_debug_account_sleep_time(delta); |
955 | } | 947 | } |
956 | 948 | ||