linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 7775/7923] include/linux/mm.h:918:23: error: implicit declaration of function 'page_to_section' is invalid in C99
Date: Wed, 25 Jan 2023 18:09:41 +0800	[thread overview]
Message-ID: <202301251732.JQM5ZRvn-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9fbee811e479aca2f3523787cae1f46553141b40
commit: 59c975083d3705f1df1355f90150df6c40360a16 [7775/7923] mm: add folio_estimated_mapcount()
config: i386-randconfig-r025-20230123 (https://download.01.org/0day-ci/archive/20230125/202301251732.JQM5ZRvn-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=59c975083d3705f1df1355f90150df6c40360a16
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 59c975083d3705f1df1355f90150df6c40360a16
        # 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=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 prepare

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

Note: the linux-next/master HEAD 9fbee811e479aca2f3523787cae1f46553141b40 builds fine.
      It may have been fixed somewhere.

All errors (new ones prefixed by >>):

   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
>> include/linux/mm.h:918:23: error: implicit declaration of function 'page_to_section' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           return page_mapcount(folio_page(folio, 0));
                                ^
   include/linux/page-flags.h:286:30: note: expanded from macro 'folio_page'
   #define folio_page(folio, n)    nth_page(&(folio)->page, n)
                                   ^
   include/linux/mm.h:216:38: note: expanded from macro 'nth_page'
   #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
                                        ^
   include/asm-generic/memory_model.h:52:21: note: expanded from macro 'page_to_pfn'
   #define page_to_pfn __page_to_pfn
                       ^
   include/asm-generic/memory_model.h:35:14: note: expanded from macro '__page_to_pfn'
           int __sec = page_to_section(__pg);                      \
                       ^
   include/linux/mm.h:918:23: note: did you mean '__nr_to_section'?
   include/linux/page-flags.h:286:30: note: expanded from macro 'folio_page'
   #define folio_page(folio, n)    nth_page(&(folio)->page, n)
                                   ^
   include/linux/mm.h:216:38: note: expanded from macro 'nth_page'
   #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
                                        ^
   include/asm-generic/memory_model.h:52:21: note: expanded from macro 'page_to_pfn'
   #define page_to_pfn __page_to_pfn
                       ^
   include/asm-generic/memory_model.h:35:14: note: expanded from macro '__page_to_pfn'
           int __sec = page_to_section(__pg);                      \
                       ^
   include/linux/mmzone.h:1843:35: note: '__nr_to_section' declared here
   static inline struct mem_section *__nr_to_section(unsigned long nr)
                                     ^
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:20:
>> include/linux/mm.h:1626:29: error: static declaration of 'page_to_section' follows non-static declaration
   static inline unsigned long page_to_section(const struct page *page)
                               ^
   include/linux/mm.h:918:23: note: previous implicit declaration is here
           return page_mapcount(folio_page(folio, 0));
                                ^
   include/linux/page-flags.h:286:30: note: expanded from macro 'folio_page'
   #define folio_page(folio, n)    nth_page(&(folio)->page, n)
                                   ^
   include/linux/mm.h:216:38: note: expanded from macro 'nth_page'
   #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
                                        ^
   include/asm-generic/memory_model.h:52:21: note: expanded from macro 'page_to_pfn'
   #define page_to_pfn __page_to_pfn
                       ^
   include/asm-generic/memory_model.h:35:14: note: expanded from macro '__page_to_pfn'
           int __sec = page_to_section(__pg);                      \
                       ^
   2 errors generated.
   make[2]: *** [scripts/Makefile.build:114: arch/x86/kernel/asm-offsets.s] Error 1
   make[2]: Target 'prepare' not remade because of errors.
   make[1]: *** [Makefile:1286: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:242: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/page_to_section +918 include/linux/mm.h

   915	
   916	static inline int folio_estimated_mapcount(struct folio *folio)
   917	{
 > 918		return page_mapcount(folio_page(folio, 0));
   919	}
   920	

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


                 reply	other threads:[~2023-01-25 10:12 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=202301251732.JQM5ZRvn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=vishal.moola@gmail.com \
    /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