Re: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h

kernel test robot
2024-02-17T16:03:42Z

Hi Max,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20240215]
[cannot apply to akpm-mm/mm-everything char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus powerpc/next powerpc/fixes linus/master v6.8-rc4 v6.8-rc3 v6.8-rc2 v6.8-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Max-Kellermann/drivers-add-missing-includes-on-linux-mm-h-and-others/20240215-225853
base: next-20240215
patch link: https://lore.kernel.org/r/20240215145602.1371274-15-max.kellermann%40ionos.com
patch subject: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h
config: nios2-allnoconfig (https://download.01.org/0day-ci/archive/20240217/202402172345.crcmOhf2-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240217/202402172345.crcmOhf2-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/202402172345.crcmOhf2-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

lib/scatterlist.c: In function 'sg_page_count':
>> lib/scatterlist.c:739:16: error: implicit declaration of function 'PAGE_ALIGN'; did you mean 'PTR_ALIGN'? [-Werror=implicit-function-declaration]
739 | return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT;
| ^~~~~~~~~~
| PTR_ALIGN
lib/scatterlist.c: In function 'extract_user_to_sg':
>> lib/scatterlist.c:1153:17: error: implicit declaration of function 'unpin_user_page'; did you mean 'copy_user_page'? [-Werror=implicit-function-declaration]
1153 | unpin_user_page(sg_page(&sgtable->sgl[--sgtable->nents]));
| ^~~~~~~~~~~~~~~
| copy_user_page
lib/scatterlist.c: In function 'extract_kvec_to_sg':
>> lib/scatterlist.c:1239:29: error: implicit declaration of function 'is_vmalloc_or_module_addr' [-Werror=implicit-function-declaration]
1239 | if (is_vmalloc_or_module_addr((void *)kaddr))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> lib/scatterlist.c:1240:40: error: implicit declaration of function 'vmalloc_to_page'; did you mean 'vmalloc_nr_pages'? [-Werror=implicit-function-declaration]
1240 | page = vmalloc_to_page((void *)kaddr);
| ^~~~~~~~~~~~~~~
| vmalloc_nr_pages
>> lib/scatterlist.c:1240:38: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1240 | page = vmalloc_to_page((void *)kaddr);
| ^
cc1: some warnings being treated as errors
--
In file included from include/linux/mm_inline.h:6,
from mm/mmu_gather.c:6:
>> include/linux/huge_mm.h:12:19: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
12 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:12:35: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
12 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
| ^~~~~
| pgd_t
>> include/linux/huge_mm.h:16:19: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
16 | pud_t *dst_pud, pud_t *src_pud, unsigned long addr,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:16:35: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
16 | pud_t *dst_pud, pud_t *src_pud, unsigned long addr,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:22:64: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
22 | static inline void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud)
| ^~~~~
| pgd_t
include/linux/huge_mm.h:29:28: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
29 | pmd_t *pmd, unsigned long addr, unsigned long next);
| ^~~~~
| pgd_t
include/linux/huge_mm.h:30:70: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
30 | int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:32:70: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
32 | int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, pud_t *pud,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:35:44: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
35 | unsigned long new_addr, pmd_t *old_pmd, pmd_t *new_pmd);
| ^~~~~
| pgd_t
include/linux/huge_mm.h:35:60: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
35 | unsigned long new_addr, pmd_t *old_pmd, pmd_t *new_pmd);
| ^~~~~
| pgd_t
include/linux/huge_mm.h:37:21: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
37 | pmd_t *pmd, unsigned long addr, pgprot_t newprot,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:437:65: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
437 | static inline void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:464:31: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
464 | static inline int is_swap_pmd(pmd_t pmd)
| ^~~~~
| pgd_t
include/linux/huge_mm.h:468:47: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
468 | static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:473:47: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
473 | static inline spinlock_t *pud_trans_huge_lock(pud_t *pud,
| ^~~~~
| pgd_t
include/linux/huge_mm.h:489:37: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
489 | static inline bool is_huge_zero_pmd(pmd_t pmd)
| ^~~~~
| pgd_t
include/linux/huge_mm.h:494:37: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
494 | static inline bool is_huge_zero_pud(pud_t pud)
| ^~~~~
| pgd_t
include/linux/huge_mm.h:505:29: error: unknown type name 'pmd_t'; did you mean 'pgd_t'?
505 | unsigned long addr, pmd_t *pmd, int flags, struct dev_pagemap **pgmap)
| ^~~~~
| pgd_t
include/linux/huge_mm.h:511:29: error: unknown type name 'pud_t'; did you mean 'pgd_t'?
511 | unsigned long addr, pud_t *pud, int flags, struct dev_pagemap **pgmap)
| ^~~~~
| pgd_t

vim +739 lib/scatterlist.c

a321e91b6d73ed Imre Deak 2013-02-27 736
a321e91b6d73ed Imre Deak 2013-02-27 737 static int sg_page_count(struct scatterlist *sg)
a321e91b6d73ed Imre Deak 2013-02-27 738 {
a321e91b6d73ed Imre Deak 2013-02-27 @739 return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT;
a321e91b6d73ed Imre Deak 2013-02-27 740 }
a321e91b6d73ed Imre Deak 2013-02-27 741

--
0-DAY CI Kernel Test Service