[akpm-mm:mm-unstable 61/88] mm/cma.c:811: warning: Function parameter or struct member 'gfp' not described in '__cma_alloc'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   495206a68b359eb6117d0860861578113bbb94e7
commit: 77cbd63e91fa6c5f6157a30e61a380b6c47c1443 [61/88] mm, cma: support multiple contiguous ranges, if requested
config: x86_64-buildonly-randconfig-001-20250131 (https://download.01.org/0day-ci/archive/20250131/202501311137.rMiQNfi3-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250131/202501311137.rMiQNfi3-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501311137.rMiQNfi3-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> mm/cma.c:811: warning: Function parameter or struct member 'gfp' not described in '__cma_alloc'
>> mm/cma.c:811: warning: expecting prototype for cma_alloc(). Prototype was for __cma_alloc() instead


vim +811 mm/cma.c

   798	
   799	/**
   800	 * cma_alloc() - allocate pages from contiguous area
   801	 * @cma:   Contiguous memory region for which the allocation is performed.
   802	 * @count: Requested number of pages.
   803	 * @align: Requested alignment of pages (in PAGE_SIZE order).
   804	 * @no_warn: Avoid printing message about failed allocation
   805	 *
   806	 * This function allocates part of contiguous memory on specific
   807	 * contiguous memory area.
   808	 */
   809	static struct page *__cma_alloc(struct cma *cma, unsigned long count,
   810			       unsigned int align, gfp_t gfp)
 > 811	{
   812		struct page *page = NULL;
   813		int ret = -ENOMEM, r;
   814		unsigned long i;
   815		const char *name = cma ? cma->name : NULL;
   816	
   817		trace_cma_alloc_start(name, count, align);
   818	
   819		if (!cma || !cma->count)
   820			return page;
   821	
   822		pr_debug("%s(cma %p, name: %s, count %lu, align %d)\n", __func__,
   823			(void *)cma, cma->name, count, align);
   824	
   825		if (!count)
   826			return page;
   827	
   828		for (r = 0; r < cma->nranges; r++) {
   829			page = NULL;
   830	
   831			ret = cma_range_alloc(cma, &cma->ranges[r], count, align,
   832					       &page, gfp);
   833			if (ret != -EBUSY || page)
   834				break;
   835		}
   836	
   837		/*
   838		 * CMA can allocate multiple page blocks, which results in different
   839		 * blocks being marked with different tags. Reset the tags to ignore
   840		 * those page blocks.
   841		 */
   842		if (page) {
   843			for (i = 0; i < count; i++)
   844				page_kasan_tag_reset(nth_page(page, i));
   845		}
   846	
   847		if (ret && !(gfp & __GFP_NOWARN)) {
   848			pr_err_ratelimited("%s: %s: alloc failed, req-size: %lu pages, ret: %d\n",
   849					   __func__, cma->name, count, ret);
   850			cma_debug_show_areas(cma);
   851		}
   852	
   853		pr_debug("%s(): returned %p\n", __func__, page);
   854		trace_cma_alloc_finish(name, page ? page_to_pfn(page) : 0,
   855				       page, count, align, ret);
   856		if (page) {
   857			count_vm_event(CMA_ALLOC_SUCCESS);
   858			cma_sysfs_account_success_pages(cma, count);
   859		} else {
   860			count_vm_event(CMA_ALLOC_FAIL);
   861			cma_sysfs_account_fail_pages(cma, count);
   862		}
   863	
   864		return page;
   865	}
   866	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux