[crng-random:jd/not-zero-entropy 8/12] arch/nios2/include/asm/timex.h:12:63: error: implicit declaration of function 'sched_clock'; did you mean 'sched_fork'?

From: kernel test robot
Date: Sun Apr 10 2022 - 12:36:16 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git jd/not-zero-entropy
head: efec3e2057963ad20223fa50a657b3ca9314ed45
commit: 375f51ba327a3403d8ea14f4292a8ac14c57428e [8/12] nios2: use sched_clock() for random_get_entropy() instead of zero
config: nios2-randconfig-r033-20220410 (https://download.01.org/0day-ci/archive/20220411/202204110002.cY2Rt9Sq-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 11.2.0
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=375f51ba327a3403d8ea14f4292a8ac14c57428e
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
git checkout 375f51ba327a3403d8ea14f4292a8ac14c57428e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/char/

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

All errors (new ones prefixed by >>):

In file included from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/rhashtable-types.h:15,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/utsname.h:6,
from drivers/char/random.c:30:
drivers/char/random.c: In function 'extract_entropy':
>> arch/nios2/include/asm/timex.h:12:63: error: implicit declaration of function 'sched_clock'; did you mean 'sched_fork'? [-Werror=implicit-function-declaration]
12 | #define random_get_entropy() ((unsigned long)(get_cycles() ?: sched_clock()))
| ^~~~~~~~~~~
drivers/char/random.c:847:43: note: in expansion of macro 'random_get_entropy'
847 | block.rdseed[i] = random_get_entropy();
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +12 arch/nios2/include/asm/timex.h

11
> 12 #define random_get_entropy() ((unsigned long)(get_cycles() ?: sched_clock()))
13

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