Commit e06fde37 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by John Stultz

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: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent dc01c9fa
...@@ -153,16 +153,10 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) ...@@ -153,16 +153,10 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)
/* Timekeeper helper functions. */ /* Timekeeper helper functions. */
#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
u32 (*arch_gettimeoffset)(void); static u32 default_arch_gettimeoffset(void) { return 0; }
u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset;
u32 get_arch_timeoffset(void)
{
if (likely(arch_gettimeoffset))
return arch_gettimeoffset();
return 0;
}
#else #else
static inline u32 get_arch_timeoffset(void) { return 0; } static inline u32 arch_gettimeoffset(void) { return 0; }
#endif #endif
static inline s64 timekeeping_get_ns(struct timekeeper *tk) static inline s64 timekeeping_get_ns(struct timekeeper *tk)
...@@ -182,7 +176,7 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk) ...@@ -182,7 +176,7 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk)
nsec >>= tk->shift; nsec >>= tk->shift;
/* If arch requires, add in get_arch_timeoffset() */ /* If arch requires, add in get_arch_timeoffset() */
return nsec + get_arch_timeoffset(); return nsec + arch_gettimeoffset();
} }
static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
...@@ -202,7 +196,7 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) ...@@ -202,7 +196,7 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
/* If arch requires, add in get_arch_timeoffset() */ /* If arch requires, add in get_arch_timeoffset() */
return nsec + get_arch_timeoffset(); return nsec + arch_gettimeoffset();
} }
static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); static RAW_NOTIFIER_HEAD(pvclock_gtod_chain);
...@@ -282,7 +276,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) ...@@ -282,7 +276,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
tk->xtime_nsec += cycle_delta * tk->mult; tk->xtime_nsec += cycle_delta * tk->mult;
/* If arch requires, add in get_arch_timeoffset() */ /* If arch requires, add in get_arch_timeoffset() */
tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift; tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
tk_normalize_xtime(tk); tk_normalize_xtime(tk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment