Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [anna-maria-devel:timers/misc 6/15] include/asm-generic/delay.h:61:26: error: call to undeclared function 'DIV_ROUND_UP'; ISO C99 and later do not support implicit function declarations
@ 2024-09-13 13:41 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-13 13:41 UTC (permalink / raw)
  To: Anna-Maria Behnsen; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/anna-maria/linux-devel.git timers/misc
head:   d8b99542c586f757608f98bb341fb75cbf96619d
commit: c774df411d1da02f75334976241deb88f8b9e256 [6/15] delay: Rework udelay and ndelay
config: i386-buildonly-randconfig-005-20240913 (https://download.01.org/0day-ci/archive/20240913/202409132123.33tT1ILn-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240913/202409132123.33tT1ILn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409132123.33tT1ILn-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/x86/kernel/reboot_fixups_32.c:11:
   In file included from arch/x86/include/asm/delay.h:5:
>> include/asm-generic/delay.h:61:26: error: call to undeclared function 'DIV_ROUND_UP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      61 |                         __const_udelay(usec * UDELAY_CONST_MULT);
         |                                               ^
   include/asm-generic/delay.h:21:43: note: expanded from macro 'UDELAY_CONST_MULT'
      21 | #define UDELAY_CONST_MULT       ((unsigned long)DIV_ROUND_UP(1ULL << 32, USEC_PER_SEC))
         |                                                 ^
   include/asm-generic/delay.h:79:26: error: call to undeclared function 'DIV_ROUND_UP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      79 |                         __const_udelay(nsec * NDELAY_CONST_MULT);
         |                                               ^
   include/asm-generic/delay.h:22:43: note: expanded from macro 'NDELAY_CONST_MULT'
      22 | #define NDELAY_CONST_MULT       ((unsigned long)DIV_ROUND_UP(1ULL << 32, NSEC_PER_SEC))
         |                                                 ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                                       ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:27: warning: array index 3 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:115:5: warning: array index 2 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/x86/kernel/reboot_fixups_32.c:12:
   In file included from include/linux/pci.h:2075:
   In file included from arch/x86/include/asm/pci.h:5:
   In file included from include/linux/mm.h:1127:
   In file included from include/linux/huge_mm.h:8:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:115:21: warning: array index 2 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];


vim +/DIV_ROUND_UP +61 include/asm-generic/delay.h

    29	
    30	/**
    31	 * udelay - Inserting a delay based on microseconds with busy waiting
    32	 * @usec:	requested delay in microseconds
    33	 *
    34	 * When delaying in an atomic context ndelay(), udelay() and mdelay() are the
    35	 * only valid variants of delaying/sleeping to go with.
    36	 *
    37	 * When inserting delays in non atomic context which are shorter than the time
    38	 * which is required to queue e.g. an hrtimer and to enter then the scheduler,
    39	 * it is also valuable to use udelay(). But is not simple to specify a generic
    40	 * threshold for this which will fit for all systems, but an approximation would
    41	 * be a threshold for all delays up to 10 microseconds.
    42	 *
    43	 * When having a delay which is larger than the architecture specific
    44	 * %MAX_UDELAY_MS value, please make sure mdelay() is used. Otherwise a overflow
    45	 * risk is given.
    46	 *
    47	 * Please note that ndelay(), udelay() and mdelay() may return early for several
    48	 * reasons (https://lists.openwall.net/linux-kernel/2011/01/09/56):
    49	 *
    50	 * #. computed loops_per_jiffy too low (due to the time taken to execute the
    51	 *    timer interrupt.)
    52	 * #. cache behaviour affecting the time it takes to execute the loop function.
    53	 * #. CPU clock rate changes.
    54	 */
    55	static __always_inline void udelay(unsigned long usec)
    56	{
    57		if (__builtin_constant_p(usec)) {
    58			if (usec >= DELAY_CONST_MAX)
    59				__bad_udelay();
    60			else
  > 61				__const_udelay(usec * UDELAY_CONST_MULT);
    62		} else {
    63			__udelay(usec);
    64		}
    65	}
    66	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-13 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 13:41 [anna-maria-devel:timers/misc 6/15] include/asm-generic/delay.h:61:26: error: call to undeclared function 'DIV_ROUND_UP'; ISO C99 and later do not support implicit function declarations kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox