aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 17:03:50 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 13:16:50 -0400
commite06fde37b860f5030e93475a2a95857af7ad13e1 (patch)
treebe1a2967bec476c1f56a3238240200d330842997
parentdc01c9fae1c5e40458c086a868d2028dfd6faebd (diff)
timekeeping: Simplify arch_gettimeoffset()
Provide a default stub function instead of having the extra conditional. Cuts binary size on a m68k build by ~100 bytes. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/time/timekeeping.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 32d8d6aaedb8..908861c58e62 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -153,16 +153,10 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)
153/* Timekeeper helper functions. */ 153/* Timekeeper helper functions. */
154 154
155#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET 155#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
156u32 (*arch_gettimeoffset)(void); 156static u32 default_arch_gettimeoffset(void) { return 0; }
157 157u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset;
158u32 get_arch_timeoffset(void)
159{
160 if (likely(arch_gettimeoffset))
161 return arch_gettimeoffset();
162 return 0;
163}
164#else 158#else
165static inline u32 get_arch_timeoffset(void) { return 0; } 159static inline u32 arch_gettimeoffset(void) { return 0; }
166#endif 160#endif
167 161
168static inline s64 timekeeping_get_ns(struct timekeeper *tk) 162static inline s64 timekeeping_get_ns(struct timekeeper *tk)
@@ -182,7 +176,7 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk)
182 nsec >>= tk->shift; 176 nsec >>= tk->shift;
183 177
184 /* If arch requires, add in get_arch_timeoffset() */ 178 /* If arch requires, add in get_arch_timeoffset() */
185 return nsec + get_arch_timeoffset(); 179 return nsec + arch_gettimeoffset();
186} 180}
187 181
188static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) 182static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
@@ -202,7 +196,7 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
202 nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); 196 nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
203 197
204 /* If arch requires, add in get_arch_timeoffset() */ 198 /* If arch requires, add in get_arch_timeoffset() */
205 return nsec + get_arch_timeoffset(); 199 return nsec + arch_gettimeoffset();
206} 200}
207 201
208static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); 202static RAW_NOTIFIER_HEAD(pvclock_gtod_chain);
@@ -282,7 +276,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
282 tk->xtime_nsec += cycle_delta * tk->mult; 276 tk->xtime_nsec += cycle_delta * tk->mult;
283 277
284 /* If arch requires, add in get_arch_timeoffset() */ 278 /* If arch requires, add in get_arch_timeoffset() */
285 tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift; 279 tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
286 280
287 tk_normalize_xtime(tk); 281 tk_normalize_xtime(tk);
288 282