Fix compilation of powerpc asm-offsets.c with old gcc

Commit ad7f71674ad7c3c4467e48f6ab9e85516dae2720 ("[POWERPC] Use a
sensible default for clock_getres() in the VDSO") corrected the clock
resolution reported by the VDSO clock_getres() but introduced another
problem in that older versions of gcc (gcc-4.0 and earlier) fail to
compile the new code in arch/powerpc/kernel/asm-offsets.c.

This fixes it by introducing a new MONOTONIC_RES_NSEC define in the
generic code which is equivalent to KTIME_MONOTONIC_RES but is just an
integer constant, not a ktime union.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Tony Breeds and committed by Linus Torvalds 151db1fc 145e9230

+7 -3
+1 -1
arch/powerpc/kernel/asm-offsets.c
··· 313 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); 314 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); 315 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); 316 - DEFINE(CLOCK_REALTIME_RES, (KTIME_MONOTONIC_RES).tv64); 317 318 #ifdef CONFIG_BUG 319 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
··· 313 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); 314 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); 315 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); 316 + DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); 317 318 #ifdef CONFIG_BUG 319 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
+4 -1
include/linux/hrtimer.h
··· 225 * idea of the (in)accuracy of timers. Timer values are rounded up to 226 * this resolution values. 227 */ 228 - # define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } 229 # define KTIME_MONOTONIC_RES KTIME_HIGH_RES 230 231 #else 232 233 # define KTIME_MONOTONIC_RES KTIME_LOW_RES 234 235 /*
··· 225 * idea of the (in)accuracy of timers. Timer values are rounded up to 226 * this resolution values. 227 */ 228 + # define HIGH_RES_NSEC 1 229 + # define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC } 230 + # define MONOTONIC_RES_NSEC HIGH_RES_NSEC 231 # define KTIME_MONOTONIC_RES KTIME_HIGH_RES 232 233 #else 234 235 + # define MONOTONIC_RES_NSEC LOW_RES_NSEC 236 # define KTIME_MONOTONIC_RES KTIME_LOW_RES 237 238 /*
+2 -1
include/linux/ktime.h
··· 316 * idea of the (in)accuracy of timers. Timer values are rounded up to 317 * this resolution values. 318 */ 319 - #define KTIME_LOW_RES (ktime_t){ .tv64 = TICK_NSEC } 320 321 /* Get the monotonic time in timespec format: */ 322 extern void ktime_get_ts(struct timespec *ts);
··· 316 * idea of the (in)accuracy of timers. Timer values are rounded up to 317 * this resolution values. 318 */ 319 + #define LOW_RES_NSEC TICK_NSEC 320 + #define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC } 321 322 /* Get the monotonic time in timespec format: */ 323 extern void ktime_get_ts(struct timespec *ts);