diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/timer.h | 22 | ||||
-rw-r--r-- | include/linux/timex.h | 2 |
2 files changed, 3 insertions, 21 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index daf9685b861c..e2d662e3416e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -86,8 +86,8 @@ static inline int timer_pending(const struct timer_list * timer) | |||
86 | 86 | ||
87 | extern void add_timer_on(struct timer_list *timer, int cpu); | 87 | extern void add_timer_on(struct timer_list *timer, int cpu); |
88 | extern int del_timer(struct timer_list * timer); | 88 | extern int del_timer(struct timer_list * timer); |
89 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); | ||
90 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | 89 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
90 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); | ||
91 | 91 | ||
92 | /* | 92 | /* |
93 | * The jiffies value which is added to now, when there is no timer | 93 | * The jiffies value which is added to now, when there is no timer |
@@ -146,25 +146,7 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | |||
146 | } | 146 | } |
147 | #endif | 147 | #endif |
148 | 148 | ||
149 | /** | 149 | extern void add_timer(struct timer_list *timer); |
150 | * add_timer - start a timer | ||
151 | * @timer: the timer to be added | ||
152 | * | ||
153 | * The kernel will do a ->function(->data) callback from the | ||
154 | * timer interrupt at the ->expires point in the future. The | ||
155 | * current time is 'jiffies'. | ||
156 | * | ||
157 | * The timer's ->expires, ->function (and if the handler uses it, ->data) | ||
158 | * fields must be set prior calling this function. | ||
159 | * | ||
160 | * Timers with an ->expires field in the past will be executed in the next | ||
161 | * timer tick. | ||
162 | */ | ||
163 | static inline void add_timer(struct timer_list *timer) | ||
164 | { | ||
165 | BUG_ON(timer_pending(timer)); | ||
166 | __mod_timer(timer, timer->expires); | ||
167 | } | ||
168 | 150 | ||
169 | #ifdef CONFIG_SMP | 151 | #ifdef CONFIG_SMP |
170 | extern int try_to_del_timer_sync(struct timer_list *timer); | 152 | extern int try_to_del_timer_sync(struct timer_list *timer); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 998a55d80acf..aa3475fcff64 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -190,7 +190,7 @@ struct timex { | |||
190 | * offset and maximum frequency tolerance. | 190 | * offset and maximum frequency tolerance. |
191 | */ | 191 | */ |
192 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | 192 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ |
193 | #define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) | 193 | #define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) |
194 | #define PPM_SCALE_INV_SHIFT 19 | 194 | #define PPM_SCALE_INV_SHIFT 19 |
195 | #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ | 195 | #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ |
196 | PPM_SCALE + 1) | 196 | PPM_SCALE + 1) |