tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git asm-generic-fixes head: cdfde8f61a004fa5797d40581077603c142adca1 commit: cdfde8f61a004fa5797d40581077603c142adca1 [1/1] asm-generic: correct reference to GENERIC_LIB_DEVMEM_IS_ALLOWED config: riscv-randconfig-r035-20220707 (https://download.01.org/0day-ci/archive/20220708/202207080606.J3uB2s10-lkp@xxxxxxxxx/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 66ae1d60bb278793fd651cece264699d522bab84) 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 # install riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/commit/?id=cdfde8f61a004fa5797d40581077603c142adca1 git remote add arnd-asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git git fetch --no-tags arnd-asm-generic asm-generic-fixes git checkout cdfde8f61a004fa5797d40581077603c142adca1 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/char/ drivers/hwmon/pmbus/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): >> drivers/char/mem.c:66:9: error: call to undeclared function 'devmem_is_allowed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] return devmem_is_allowed(pfn); ^ drivers/char/mem.c:66:9: note: did you mean 'page_is_allowed'? drivers/char/mem.c:64:19: note: 'page_is_allowed' declared here static inline int page_is_allowed(unsigned long pfn) ^ drivers/char/mem.c:75:8: error: call to undeclared function 'devmem_is_allowed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!devmem_is_allowed(pfn)) ^ 2 errors generated. vim +/devmem_is_allowed +66 drivers/char/mem.c ^1da177e4c3f415 Linus Torvalds 2005-04-16 62 d092633bff3b19f Ingo Molnar 2008-07-18 63 #ifdef CONFIG_STRICT_DEVMEM a4866aa812518ed Kees Cook 2017-04-05 64 static inline int page_is_allowed(unsigned long pfn) a4866aa812518ed Kees Cook 2017-04-05 65 { a4866aa812518ed Kees Cook 2017-04-05 @66 return devmem_is_allowed(pfn); a4866aa812518ed Kees Cook 2017-04-05 67 } e2beb3eae627211 Venki Pallipadi 2008-03-06 68 static inline int range_is_allowed(unsigned long pfn, unsigned long size) ae531c26c5c2a28 Arjan van de Ven 2008-04-24 69 { e2beb3eae627211 Venki Pallipadi 2008-03-06 70 u64 from = ((u64)pfn) << PAGE_SHIFT; e2beb3eae627211 Venki Pallipadi 2008-03-06 71 u64 to = from + size; e2beb3eae627211 Venki Pallipadi 2008-03-06 72 u64 cursor = from; e2beb3eae627211 Venki Pallipadi 2008-03-06 73 e2beb3eae627211 Venki Pallipadi 2008-03-06 74 while (cursor < to) { 39380b80d727232 Jiri Kosina 2016-07-08 75 if (!devmem_is_allowed(pfn)) ae531c26c5c2a28 Arjan van de Ven 2008-04-24 76 return 0; e2beb3eae627211 Venki Pallipadi 2008-03-06 77 cursor += PAGE_SIZE; e2beb3eae627211 Venki Pallipadi 2008-03-06 78 pfn++; ae531c26c5c2a28 Arjan van de Ven 2008-04-24 79 } ae531c26c5c2a28 Arjan van de Ven 2008-04-24 80 return 1; ae531c26c5c2a28 Arjan van de Ven 2008-04-24 81 } ae531c26c5c2a28 Arjan van de Ven 2008-04-24 82 #else a4866aa812518ed Kees Cook 2017-04-05 83 static inline int page_is_allowed(unsigned long pfn) a4866aa812518ed Kees Cook 2017-04-05 84 { a4866aa812518ed Kees Cook 2017-04-05 85 return 1; a4866aa812518ed Kees Cook 2017-04-05 86 } e2beb3eae627211 Venki Pallipadi 2008-03-06 87 static inline int range_is_allowed(unsigned long pfn, unsigned long size) ae531c26c5c2a28 Arjan van de Ven 2008-04-24 88 { ae531c26c5c2a28 Arjan van de Ven 2008-04-24 89 return 1; ae531c26c5c2a28 Arjan van de Ven 2008-04-24 90 } ae531c26c5c2a28 Arjan van de Ven 2008-04-24 91 #endif ae531c26c5c2a28 Arjan van de Ven 2008-04-24 92 :::::: The code at line 66 was first introduced by commit :::::: a4866aa812518ed1a37d8ea0c881dc946409de94 mm: Tighten x86 /dev/mem with zeroing reads :::::: TO: Kees Cook <keescook@xxxxxxxxxxxx> :::::: CC: Kees Cook <keescook@xxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://01.org/lkp