[crng-random:jd/not-zero-entropy-ktime 10/13] include/linux/timekeeping.h:121:9: error: implicit declaration of function 'timespec64_to_ktime' is invalid in C99

From: kernel test robot
Date: Sun Apr 10 2022 - 12:56:18 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git jd/not-zero-entropy-ktime
head: 340a25fe529e8fc1df1a82b42f021a9d0fa4fb51
commit: 7376542333df813e81252121f5ebd8e91c0fb3b6 [10/13] x86: use ktime_read_raw_clock() for random_get_entropy() instead of zero
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220411/202204110039.k9CNcBlM-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 256c6b0ba14e8a7ab6373b61b7193ea8c0a3651c)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?id=7376542333df813e81252121f5ebd8e91c0fb3b6
git remote add crng-random git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git
git fetch --no-tags crng-random jd/not-zero-entropy-ktime
git checkout 7376542333df813e81252121f5ebd8e91c0fb3b6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 prepare

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

include/linux/timekeeping.h:98:15: error: unknown type name 'ktime_t'; did you mean 'timer_t'?
static inline ktime_t ktime_get_coarse_boottime(void)
^~~~~~~
timer_t
include/linux/types.h:26:26: note: 'timer_t' declared here
typedef __kernel_timer_t timer_t;
^
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:21:
In file included from include/linux/mm_types.h:15:
In file included from include/linux/uprobes.h:49:
In file included from arch/x86/include/asm/uprobes.h:13:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:60:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/x86/include/asm/timex.h:6:
In file included from arch/x86/include/asm/tsc.h:8:
include/linux/timekeeping.h:106:15: error: unknown type name 'ktime_t'; did you mean 'timer_t'?
static inline ktime_t ktime_get_clocktai(void)
^~~~~~~
timer_t
include/linux/types.h:26:26: note: 'timer_t' declared here
typedef __kernel_timer_t timer_t;
^
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:21:
In file included from include/linux/mm_types.h:15:
In file included from include/linux/uprobes.h:49:
In file included from arch/x86/include/asm/uprobes.h:13:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:60:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/x86/include/asm/timex.h:6:
In file included from arch/x86/include/asm/tsc.h:8:
include/linux/timekeeping.h:111:15: error: unknown type name 'ktime_t'; did you mean 'timer_t'?
static inline ktime_t ktime_get_coarse_clocktai(void)
^~~~~~~
timer_t
include/linux/types.h:26:26: note: 'timer_t' declared here
typedef __kernel_timer_t timer_t;
^
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:21:
In file included from include/linux/mm_types.h:15:
In file included from include/linux/uprobes.h:49:
In file included from arch/x86/include/asm/uprobes.h:13:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:60:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/x86/include/asm/timex.h:6:
In file included from arch/x86/include/asm/tsc.h:8:
include/linux/timekeeping.h:116:15: error: unknown type name 'ktime_t'; did you mean 'timer_t'?
static inline ktime_t ktime_get_coarse(void)
^~~~~~~
timer_t
include/linux/types.h:26:26: note: 'timer_t' declared here
typedef __kernel_timer_t timer_t;
^
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:21:
In file included from include/linux/mm_types.h:15:
In file included from include/linux/uprobes.h:49:
In file included from arch/x86/include/asm/uprobes.h:13:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:60:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/x86/include/asm/timex.h:6:
In file included from arch/x86/include/asm/tsc.h:8:
>> include/linux/timekeeping.h:121:9: error: implicit declaration of function 'timespec64_to_ktime' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return timespec64_to_ktime(ts);
^
include/linux/timekeeping.h:121:9: note: did you mean 'timespec64_to_ns'?
include/linux/time64.h:127:19: note: 'timespec64_to_ns' declared here
static inline s64 timespec64_to_ns(const struct timespec64 *ts)
^
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:21:
In file included from include/linux/mm_types.h:15:
In file included from include/linux/uprobes.h:49:
In file included from arch/x86/include/asm/uprobes.h:13:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:60:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/x86/include/asm/timex.h:6:
In file included from arch/x86/include/asm/tsc.h:8:
>> include/linux/timekeeping.h:126:9: error: implicit declaration of function 'ktime_to_ns' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return ktime_to_ns(ktime_get_coarse());
^
include/linux/timekeeping.h:131:9: error: implicit declaration of function 'ktime_to_ns' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return ktime_to_ns(ktime_get_coarse_real());
^
include/linux/timekeeping.h:136:9: error: implicit declaration of function 'ktime_to_ns' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return ktime_to_ns(ktime_get_coarse_boottime());
^
include/linux/timekeeping.h:141:9: error: implicit declaration of function 'ktime_to_ns' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return ktime_to_ns(ktime_get_coarse_clocktai());
^
include/linux/timekeeping.h:147:15: error: unknown type name 'ktime_t'; did you mean 'timer_t'?
static inline ktime_t ktime_mono_to_real(ktime_t mono)
^~~~~~~
timer_t
include/linux/types.h:26:26: note: 'timer_t' declared here
typedef __kernel_timer_t timer_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [scripts/Makefile.build:120: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1194: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +/timespec64_to_ktime +121 include/linux/timekeeping.h

b9ff604cff1135 Arnd Bergmann 2018-04-27 115
4c54294d01e605 Jason A. Donenfeld 2019-06-21 116 static inline ktime_t ktime_get_coarse(void)
4c54294d01e605 Jason A. Donenfeld 2019-06-21 117 {
4c54294d01e605 Jason A. Donenfeld 2019-06-21 118 struct timespec64 ts;
4c54294d01e605 Jason A. Donenfeld 2019-06-21 119
4c54294d01e605 Jason A. Donenfeld 2019-06-21 120 ktime_get_coarse_ts64(&ts);
4c54294d01e605 Jason A. Donenfeld 2019-06-21 @121 return timespec64_to_ktime(ts);
4c54294d01e605 Jason A. Donenfeld 2019-06-21 122 }
4c54294d01e605 Jason A. Donenfeld 2019-06-21 123
4c54294d01e605 Jason A. Donenfeld 2019-06-21 124 static inline u64 ktime_get_coarse_ns(void)
4c54294d01e605 Jason A. Donenfeld 2019-06-21 125 {
4c54294d01e605 Jason A. Donenfeld 2019-06-21 @126 return ktime_to_ns(ktime_get_coarse());
4c54294d01e605 Jason A. Donenfeld 2019-06-21 127 }
4c54294d01e605 Jason A. Donenfeld 2019-06-21 128

:::::: The code at line 121 was first introduced by commit
:::::: 4c54294d01e605a9f992361b924c5d8b12822a6d timekeeping: Add missing _ns functions for coarse accessors

:::::: TO: Jason A. Donenfeld <Jason@xxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://01.org/lkp