public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Jason A. Donenfeld" <zx2c4@kernel.org>
Cc: kbuild-all@lists.01.org, zx2c4@kernel.org, linux-kernel@vger.kernel.org
Subject: [crng-random:jd/not-zero-entropy 3/12] include/linux/timex.h:83:49: error: implicit declaration of function 'sched_clock'
Date: Mon, 11 Apr 2022 01:26:43 +0800	[thread overview]
Message-ID: <202204110149.L9WMl0vi-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git jd/not-zero-entropy
head:   efec3e2057963ad20223fa50a657b3ca9314ed45
commit: d921ec2a978ab8566577c18abfe20960dd0c6477 [3/12] random: use sched_clock() for random_get_entropy() if no get_cycles()
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20220411/202204110149.L9WMl0vi-lkp@intel.com/config)
compiler: powerpc-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=d921ec2a978ab8566577c18abfe20960dd0c6477
        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 d921ec2a978ab8566577c18abfe20960dd0c6477
        # 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=powerpc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   In file included from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/jiffies.h:10,
                    from lib/random32.c:38:
   lib/random32.c: In function 'prandom_init_early':
>> include/linux/timex.h:83:49: error: implicit declaration of function 'sched_clock' [-Werror=implicit-function-declaration]
      83 | #define random_get_entropy()    ((unsigned long)sched_clock())
         |                                                 ^~~~~~~~~~~
   lib/random32.c:469:22: note: in expansion of macro 'random_get_entropy'
     469 |                 v1 = random_get_entropy();
         |                      ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/sched_clock +83 include/linux/timex.h

    66	
    67	#ifndef random_get_entropy
    68	/*
    69	 * The random_get_entropy() function is used by the /dev/random driver
    70	 * in order to extract entropy via the relative unpredictability of
    71	 * when an interrupt takes places versus a high speed, fine-grained
    72	 * timing source or cycle counter.  Since it will be occurred on every
    73	 * single interrupt, it must have a very low cost/overhead.
    74	 *
    75	 * By default we use get_cycles() for this purpose, but individual
    76	 * architectures may override this in their asm/timex.h header file.
    77	 * If a given arch does not have get_cycles(), then we fallback to
    78	 * using sched_clock().
    79	 */
    80	#ifdef get_cycles
    81	#define random_get_entropy()	((unsigned long)get_cycles())
    82	#else
  > 83	#define random_get_entropy()	((unsigned long)sched_clock())
    84	#endif
    85	#endif
    86	

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

                 reply	other threads:[~2022-04-10 17:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204110149.L9WMl0vi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zx2c4@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox