oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Mike Rapoport <rppt@kernel.org>
Subject: [rppt:unmapped-alloc/rfc-v2 1/3] mm/unmapped-alloc.c:150:14: warning: no previous prototype for function 'unmapped_pages_alloc'
Date: Sat, 27 May 2023 09:50:28 +0800	[thread overview]
Message-ID: <202305270935.G4Pfcajm-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git unmapped-alloc/rfc-v2
head:   e55ecf7bdeeb7ef51b93089d7926303e8259641a
commit: c4d7927daa7a7ecd012b341e96b4d22b415c7189 [1/3] mm: intorduce unmapped_alloc()
config: x86_64-randconfig-x062-20230526 (https://download.01.org/0day-ci/archive/20230527/202305270935.G4Pfcajm-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        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/rppt/linux.git/commit/?id=c4d7927daa7a7ecd012b341e96b4d22b415c7189
        git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
        git fetch --no-tags rppt unmapped-alloc/rfc-v2
        git checkout c4d7927daa7a7ecd012b341e96b4d22b415c7189
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305270935.G4Pfcajm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/unmapped-alloc.c:150:14: warning: no previous prototype for function 'unmapped_pages_alloc' [-Wmissing-prototypes]
   struct page *unmapped_pages_alloc(gfp_t gfp, int order)
                ^
   mm/unmapped-alloc.c:150:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   struct page *unmapped_pages_alloc(gfp_t gfp, int order)
   ^
   static 
>> mm/unmapped-alloc.c:198:6: warning: no previous prototype for function 'unmapped_pages_free' [-Wmissing-prototypes]
   void unmapped_pages_free(struct page *page, int order)
        ^
   mm/unmapped-alloc.c:198:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void unmapped_pages_free(struct page *page, int order)
   ^
   static 
   2 warnings generated.


vim +/unmapped_pages_alloc +150 mm/unmapped-alloc.c

   149	
 > 150	struct page *unmapped_pages_alloc(gfp_t gfp, int order)
   151	{
   152	
   153		int cache_order = PMD_ORDER;
   154		struct page *page;
   155	
   156		page = __rmqueue_smallest(order);
   157		if (page)
   158			goto out;
   159	
   160		while (cache_order >= order) {
   161			page = alloc_pages(gfp, cache_order);
   162			if (page)
   163				break;
   164			cache_order--;
   165		}
   166	
   167		if (page) {
   168			unsigned long addr = (unsigned long)page_address(page);
   169			unsigned long nr_pages = (1 << order);
   170			unsigned long size = PAGE_SIZE * nr_pages;
   171	
   172			/* FIXME: set_direct_map_invalid_noflush may fail */
   173			for (int i = 0; i < nr_pages; i++)
   174				set_direct_map_invalid_noflush(page + i);
   175	
   176			flush_tlb_kernel_range(addr, addr + size);
   177	
   178			/*
   179			 * FIXME: have this under lock so that allocation running
   180			 * in parallel won't steal all pages from the newly cached
   181			 * ones
   182			 */
   183			__free_one_page(page, cache_order, true);
   184			page = __rmqueue_smallest(order);
   185	
   186		}
   187	
   188	out:
   189		if (page) {
   190			/* FIXME: __prep_new_page() expects page count of 0 */
   191			set_page_count(page, 0);
   192			post_alloc_hook(page, order, GFP_KERNEL);
   193		}
   194	
   195		return page;
   196	}
   197	
 > 198	void unmapped_pages_free(struct page *page, int order)
   199	{
   200		__free_one_page(page, order, false);
   201	}
   202	

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

                 reply	other threads:[~2023-05-27  1:50 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=202305270935.G4Pfcajm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rppt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).