Skip to content

Commit

Permalink
vdso: Fix clocksource.h macro detection
Browse files Browse the repository at this point in the history
CONFIG_GENERIC_GETTIMEOFDAY is a sufficient condition to verify if an
architecture implements asm/vdso/clocksource.h or not. The current
implementation wrongly assumes that the same is true for the config
option CONFIG_ARCH_CLOCKSOURCE_DATA.

This results in a series of build errors on ia64/sparc/sparc64 like this:

  In file included from ./include/linux/clocksource.h:31,
                   from ./include/linux/clockchips.h:14,
                   from ./include/linux/tick.h:8,
                   from fs/proc/stat.c:15:
  ./include/vdso/clocksource.h:9:10: fatal error: asm/vdso/clocksource.h:
  No such file or directory
      9 | #include <asm/vdso/clocksource.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~

Fix the issue removing the unneeded config condition.

Fixes: 14ee2ac ("linux/clocksource.h: Extract common header for vDSO")
Reported-by: Thomas Gleixner <[email protected]>
Signed-off-by: Vincenzo Frascino <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
fvincenzo authored and suryasaimadhu committed Mar 23, 2020
1 parent 1c1a18b commit ca214e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/vdso/clocksource.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

#include <vdso/limits.h>

#if defined(CONFIG_ARCH_CLOCKSOURCE_DATA) || \
defined(CONFIG_GENERIC_GETTIMEOFDAY)
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
#include <asm/vdso/clocksource.h>
#endif /* CONFIG_ARCH_CLOCKSOURCE_DATA || CONFIG_GENERIC_GETTIMEOFDAY */
#endif /* CONFIG_GENERIC_GETTIMEOFDAY */

enum vdso_clock_mode {
VDSO_CLOCKMODE_NONE,
Expand Down

0 comments on commit ca214e2

Please sign in to comment.