Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Subject: [davidhildenbrand:pat 5/12] mm/damon/vaddr.c:312:6: error: call to undeclared function 'pmd_trans_huge'; ISO C99 and later do not support implicit function declarations
Date: Fri, 9 May 2025 00:08:26 +0800	[thread overview]
Message-ID: <202505082358.fDWiBcNw-lkp@intel.com> (raw)

tree:   https://github.com/davidhildenbrand/linux pat
head:   bd8eaecd3fc499ee12971c7e4e1522e59c979a77
commit: 86244f66bbc1c4202c7344c1df180beffefc3f4f [5/12] x86/mm/pat: remove old pfnmap tracking interface
config: um-randconfig-002-20250508 (https://download.01.org/0day-ci/archive/20250508/202505082358.fDWiBcNw-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250508/202505082358.fDWiBcNw-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/202505082358.fDWiBcNw-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/damon/vaddr.c:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/um/include/asm/cacheflush.h:4:
   In file included from arch/um/include/asm/tlbflush.h:9:
   In file included from include/linux/mm.h:31:
   include/linux/pgtable.h:1493:1: error: expected parameter declarator
    1493 | {
         | ^
   include/linux/pgtable.h:1493:1: error: expected ')'
   include/linux/pgtable.h:1492:41: note: to match this '('
    1492 | static inline int pfnmap_setup_cachemode(unsigned long pfn, unsigned long size,
         |                                         ^
   In file included from mm/damon/vaddr.c:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/um/include/asm/cacheflush.h:4:
   In file included from arch/um/include/asm/tlbflush.h:9:
   include/linux/mm.h:1898:9: error: call to undeclared function 'is_zero_pfn'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1898 |         return is_zero_pfn(page_to_pfn(page));
         |                ^
   In file included from mm/damon/vaddr.c:12:
   include/linux/mman.h:157:9: warning: division by zero is undefined [-Wdivision-by-zero]
     157 |                _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:135:21: note: expanded from macro '_calc_vm_trans'
     135 |    : ((x) & (bit1)) / ((bit1) / (bit2))))
         |                     ^ ~~~~~~~~~~~~~~~~~
   include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
     158 |                _calc_vm_trans(flags, MAP_STACK,      VM_NOHUGEPAGE) |
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:135:21: note: expanded from macro '_calc_vm_trans'
     135 |    : ((x) & (bit1)) / ((bit1) / (bit2))))
         |                     ^ ~~~~~~~~~~~~~~~~~
>> mm/damon/vaddr.c:312:6: error: call to undeclared function 'pmd_trans_huge'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     312 |         if (pmd_trans_huge(pmdp_get(pmd))) {
         |             ^
   2 warnings and 4 errors generated.


vim +/pmd_trans_huge +312 mm/damon/vaddr.c

3f49584b262cf8 SeongJae Park 2021-09-07  304  
3f49584b262cf8 SeongJae Park 2021-09-07  305  static int damon_mkold_pmd_entry(pmd_t *pmd, unsigned long addr,
3f49584b262cf8 SeongJae Park 2021-09-07  306  		unsigned long next, struct mm_walk *walk)
3f49584b262cf8 SeongJae Park 2021-09-07  307  {
3f49584b262cf8 SeongJae Park 2021-09-07  308  	pte_t *pte;
e7ee3f9791f560 Levi Yun      2023-07-28  309  	pmd_t pmde;
3f49584b262cf8 SeongJae Park 2021-09-07  310  	spinlock_t *ptl;
3f49584b262cf8 SeongJae Park 2021-09-07  311  
e7ee3f9791f560 Levi Yun      2023-07-28 @312  	if (pmd_trans_huge(pmdp_get(pmd))) {
3f49584b262cf8 SeongJae Park 2021-09-07  313  		ptl = pmd_lock(walk->mm, pmd);
e7ee3f9791f560 Levi Yun      2023-07-28  314  		pmde = pmdp_get(pmd);
e7ee3f9791f560 Levi Yun      2023-07-28  315  
e7ee3f9791f560 Levi Yun      2023-07-28  316  		if (!pmd_present(pmde)) {
c8b9aff419303e Baolin Wang   2022-08-18  317  			spin_unlock(ptl);
c8b9aff419303e Baolin Wang   2022-08-18  318  			return 0;
c8b9aff419303e Baolin Wang   2022-08-18  319  		}
c8b9aff419303e Baolin Wang   2022-08-18  320  
e7ee3f9791f560 Levi Yun      2023-07-28  321  		if (pmd_trans_huge(pmde)) {
c11d34fa139e4b Ryan Roberts  2023-06-02  322  			damon_pmdp_mkold(pmd, walk->vma, addr);
3f49584b262cf8 SeongJae Park 2021-09-07  323  			spin_unlock(ptl);
3f49584b262cf8 SeongJae Park 2021-09-07  324  			return 0;
3f49584b262cf8 SeongJae Park 2021-09-07  325  		}
3f49584b262cf8 SeongJae Park 2021-09-07  326  		spin_unlock(ptl);
3f49584b262cf8 SeongJae Park 2021-09-07  327  	}
3f49584b262cf8 SeongJae Park 2021-09-07  328  
3f49584b262cf8 SeongJae Park 2021-09-07  329  	pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
7780d04046a228 Hugh Dickins  2023-06-08  330  	if (!pte) {
7780d04046a228 Hugh Dickins  2023-06-08  331  		walk->action = ACTION_AGAIN;
7780d04046a228 Hugh Dickins  2023-06-08  332  		return 0;
7780d04046a228 Hugh Dickins  2023-06-08  333  	}
c33c794828f212 Ryan Roberts  2023-06-12  334  	if (!pte_present(ptep_get(pte)))
3f49584b262cf8 SeongJae Park 2021-09-07  335  		goto out;
c11d34fa139e4b Ryan Roberts  2023-06-02  336  	damon_ptep_mkold(pte, walk->vma, addr);
3f49584b262cf8 SeongJae Park 2021-09-07  337  out:
3f49584b262cf8 SeongJae Park 2021-09-07  338  	pte_unmap_unlock(pte, ptl);
3f49584b262cf8 SeongJae Park 2021-09-07  339  	return 0;
3f49584b262cf8 SeongJae Park 2021-09-07  340  }
3f49584b262cf8 SeongJae Park 2021-09-07  341  

:::::: The code at line 312 was first introduced by commit
:::::: e7ee3f9791f5601fc032b222a70a02b9798784be damon: use pmdp_get instead of drectly dereferencing pmd

:::::: TO: Levi Yun <ppbuk5246@gmail.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>

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

                 reply	other threads:[~2025-05-08 16:09 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=202505082358.fDWiBcNw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=david@redhat.com \
    --cc=llvm@lists.linux.dev \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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