Skip to content

Commit

Permalink
x86/tsc: Fix broken CONFIG_X86_TSC=n build
Browse files Browse the repository at this point in the history
Add the missing return statement to the inline stub
tsc_store_and_check_tsc_adjust() and add the other stubs to make a
SMP=y,TSC=n build happy.

While at it, remove the unused variable from the UP variant of
tsc_store_and_check_tsc_adjust().

Fixes: commit ba75fb646931 ("x86/tsc: Sync test only for the first cpu in a package")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Nov 30, 2016
1 parent cc4db26 commit b836554
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions arch/x86/include/asm/tsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ extern int tsc_clocksource_reliable;
* Boot-time check whether the TSCs are synchronized across
* all CPUs/cores:
*/
extern void check_tsc_sync_source(int cpu);
extern void check_tsc_sync_target(void);

#ifdef CONFIG_X86_TSC
extern bool tsc_store_and_check_tsc_adjust(void);
extern void tsc_verify_tsc_adjust(void);
extern void check_tsc_sync_source(int cpu);
extern void check_tsc_sync_target(void);
#else
static inline bool tsc_store_and_check_tsc_adjust(void) { }
static inline bool tsc_store_and_check_tsc_adjust(void) { return false; }
static inline void tsc_verify_tsc_adjust(void) { }
static inline void check_tsc_sync_source(int cpu) { }
static inline void check_tsc_sync_target(void) { }
#endif

extern int notsc_setup(char *);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/tsc_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void tsc_verify_tsc_adjust(void)
#ifndef CONFIG_SMP
bool __init tsc_store_and_check_tsc_adjust(void)
{
struct tsc_adjust *ref, *cur = this_cpu_ptr(&tsc_adjust);
struct tsc_adjust *cur = this_cpu_ptr(&tsc_adjust);
s64 bootval;

if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST))
Expand Down

0 comments on commit b836554

Please sign in to comment.