[openeuler:OLK-6.6 2835/2835] arch/loongarch/kernel/efi.c:79:12: error: call to undeclared function 'pmd_mkhuge'; ISO C99 and later do not support implicit function declarations

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 4899f36878e0612ccb9881145064ae35377bcdcc commit: 221e2e8bdbb851a519df0bac5a44298dae2b4612 [2835/2835] LoongArch: add kernel setvirtmap for runtime config: loongarch-randconfig-001-20250902 (https://download.01.org/0day-ci/archive/20250902/202509021500.y8PdGM3g-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 2e122990391b2ba062e6308a12cfedf7206270ba) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250902/202509021500.y8PdGM3g-lkp@i...) 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/202509021500.y8PdGM3g-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from arch/loongarch/kernel/efi.c:11: In file included from include/linux/acpi.h:14: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/loongarch/include/asm/elf.h:13: In file included from arch/loongarch/include/asm/vdso.h:10: In file included from include/linux/mm.h:2168: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ In file included from arch/loongarch/kernel/efi.c:26: arch/loongarch/include/asm/tlb.h:144:24: warning: default initialization of an object of type 'struct vm_area_struct' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe] 144 | struct vm_area_struct vma; | ^ include/linux/mm_types.h:601:20: note: member 'vm_flags' declared 'const' here 601 | const vm_flags_t vm_flags; | ^
arch/loongarch/kernel/efi.c:79:12: error: call to undeclared function 'pmd_mkhuge'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 79 | entry = pmd_mkhuge(entry); | ^ arch/loongarch/kernel/efi.c:79:12: note: did you mean 'pte_mkhuge'? arch/loongarch/include/asm/pgtable.h:419:21: note: 'pte_mkhuge' declared here 419 | static inline pte_t pte_mkhuge(pte_t pte) | ^ arch/loongarch/kernel/efi.c:79:10: error: assigning to 'pmd_t' from incompatible type 'int' 79 | entry = pmd_mkhuge(entry); | ^ ~~~~~~~~~~~~~~~~~ 2 warnings and 2 errors generated.
vim +/pmd_mkhuge +79 arch/loongarch/kernel/efi.c 54 55 static int __init efimap_populate_hugepages( 56 unsigned long start, unsigned long end, 57 pgprot_t prot) 58 { 59 unsigned long addr; 60 unsigned long next; 61 pmd_t entry; 62 pud_t *pud; 63 pmd_t *pmd; 64 65 for (addr = start; addr < end; addr = next) { 66 next = pmd_addr_end(addr, end); 67 pud = pud_offset((p4d_t *)pgd_efi + pgd_index(addr), addr); 68 if (pud_none(*pud)) { 69 void *p = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); 70 71 if (!p) 72 return -1; 73 pmd_init(p); 74 pud_populate(&init_mm, pud, p); 75 } 76 pmd = pmd_offset(pud, addr); 77 if (pmd_none(*pmd)) { 78 entry = pfn_pmd((addr >> PAGE_SHIFT), prot);
79 entry = pmd_mkhuge(entry); 80 set_pmd_at(&init_mm, addr, pmd, entry); 81 } 82 } 83 return 0; 84 } 85
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot